Rank the values of a numeric variable in descending order,
and returns the result along with tidyverse code used to generate it.
Ties are broken as such: eg. values = 5, 6, 6, 7 ; rank = 1, 2, 2, 3
Usage
rankVars(.data, vars)
Value
the original dataframe containing new columns with the ranks of the
variables in var with tidyverse code attached
Arguments
.data
a dataframe with the variables to rank
vars
a character vector of numeric variables in .data
to rank