| rank_vars {iNZightTools} | R Documentation |
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.
rank_vars(data, vars, rank_type = c("min", "dense", "percent"))
data |
a dataframe with the variables to rank |
vars |
a character vector of numeric variables in |
rank_type |
either |
the original dataframe containing new columns with the ranks of the
variables in vars with tidyverse code attached
Zhaoming Su
ranked <- rank_vars(iris, vars = c("Sepal.Length", "Petal.Length"))
cat(code(ranked))
head(ranked)