How to add a column for descending row numbers into dataset in R

I am new to R and would like to insert a new column that numbers the row to a large dataset.

I have no idea how to use 'mutate()' to insert this. Would appreciate any help.

Thanks.

Topic dplyr dataset r

Category Data Science


Use mutate in combination with row_number as follows:

df %>% mutate(row = row_number())

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.