I want to ask a rank question.
suppose i have a data.frame just like following
df <- tibble(year = rep(c(1990,1991,1992),3),
num = c(1,2,3,2,2,3,4,1,2))
i want to get the rank with following
x <-
tibble(year = rep(c(1990,1991,1992),3),
num = c(1,2,3,2,2,3,4,1,2),
rank_1 = c(3,2,1,2,2,1,1,3,2))
that is say, the more lagre the num, the more little the rank_1. and when num is equal, we would choose the max rank