powered by
Rank the values of numeric variables, for example, in descending order, and then returns the result along with tidyverse code used to generate it. See row_number and percent_rank.
row_number
percent_rank
rank_vars(data, vars, rank_type = c("min", "dense", "percent"))
the original dataframe containing new columns with the ranks of the variables in vars with tidyverse code attached
vars
a dataframe with the variables to rank
a character vector of numeric variables in data to rank
data
either "min", "dense" or "percent", see row_number, percent_rank
"min"
"dense"
"percent"
Zhaoming Su
code
ranked <- rank_vars(iris, vars = c("Sepal.Length", "Petal.Length")) cat(code(ranked)) head(ranked)
Run the code above in your browser using DataLab