rank_vars | 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
code
ranked <- rank_vars(iris, vars = c("Sepal.Length", "Petal.Length"))
cat(code(ranked))
head(ranked)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.