In case of equality, this function takes precedence in the order of 'vars' as factors.
Usage
rank_top3_vars(
df,
vars,
new_colname_top1,
new_colname_top2,
new_colname_top3,
id_col = "uuid"
)
Arguments
- df
A data frame.
- vars
A character vector of numeric variable names.
- new_colname_top1
The new column name for the top variable.
- new_colname_top2
The new column name for the 2nd top variable.
- new_colname_top3
The new column name for the 3rd top variable.
- id_col
The column name for the unique identifier.