powered by
Ranking functions:
row_number(): Gives other row number if empty. Equivalent to frank(ties.method = "first") if provided a vector.
row_number()
frank(ties.method = "first")
min_rank(): Equivalent to frank(ties.method = "min")
min_rank()
frank(ties.method = "min")
dense_rank(): Equivalent to frank(ties.method = "dense")
dense_rank()
frank(ties.method = "dense")
percent_rank(): Ranks by percentage from 0 to 1
percent_rank()
cume_dist(): Cumulative distribution
cume_dist()
row_number.(x)
df <- data.table(x = rep(1, 3), y = c("a", "a", "b")) df %>% mutate(row = row_number())
Run the code above in your browser using DataLab