Hi there, i have to rank high values in a column of a data frame like this:
example <- data.frame(
country=c("Arg","Uru","Arg","Uru","Arg","Uru","Arg","Uru"),
value=c(1,1,2,3,4,5,6,10))
If i would rank the values with
example$rank<- rank(-example$value)
I would have something like this:
print(example$rank)
[1] 7.5 7.5 6.0 5.0 4.0 3.0 2.0 1.0
When actually i am looking something like this:
[1] 7 8 6 5 4 3 2 1
If they are tied, i dont mind wich one has a higher rank.
Thank you!