how to add ordering number to a data frame based on descending values of a column in r?

191 Views Asked by At

I have a toy data as follows:

toy.df <- data.frame(col1 = rnorm(10))

I want to add a new column indicating the order of values(descending) in col1. I need the order index to be numbers from 1:10.

Do you have any idea?

0

There are 0 best solutions below