rank_vars {iNZightTools} | R Documentation |
Rank the data of numeric variables
Description
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
.
Usage
rank_vars(data, vars, rank_type = c("min", "dense", "percent"))
Arguments
data |
a dataframe with the variables to rank |
vars |
a character vector of numeric variables in |
rank_type |
either |
Value
the original dataframe containing new columns with the ranks of the
variables in vars
with tidyverse code attached
Author(s)
Zhaoming Su
See Also
Examples
ranked <- rank_vars(iris, vars = c("Sepal.Length", "Petal.Length"))
cat(code(ranked))
head(ranked)
[Package iNZightTools version 2.0.1 Index]