check and rename variables
check_and_rename_vars(
x,
target.var,
alternative.vars,
multiplier,
required = FALSE,
fill = NULL
)
data frame or equivalent R object.
character vector of length one, with the name of the target variable.
character vector of any length, with the names of the of alternative variables that could replace the target.
numeric vector with the multipliers to apply to the alternative variables.
logical Indicating whether an error should be triggered if no variable is found.
if required = TRUE
and fill
different from
NULL
the value is used to fill the target variable if it and
all alternative variables are missing.