lama_translate_all()
and lama_to_factor_all()
Check and translate function used by lama_translate_all()
and lama_to_factor_all()
check_and_translate_all(.data, dictionary, prefix, suffix, fn_colname,
keep_order, to_factor, is_translated, err_handler)
Either a data frame, a factor or a vector.
A lama_dictionary object, holding the translations for various variables.
A character string, which is used as prefix for the new column names.
A character string, which is used as suffix for the new column names.
A function, which transforms character string into a new character string. This function will be used to transform the old column names into new column names under which the labeled variables will then be stored.
A logical of length one, defining if the original order (factor order or alphanumerical order) of the data frame variables should be preserved.
A logical of length one, defining if the resulting labeled
variables should be factor variables (to_factor = TRUE
) or plain
character vectors (to_factor = FALSE
).
A boolean vector of length one or the same length as the
number of translations. If the vector has length one, then the same
configuration is applied to all variable translations.
If is_translated = TRUE
, then the original variable is a character
vector holding the right labels (character strings).
In this case, the labels are left unchanged, but the variables are turned
into factors with order given in the selected translations.
An error handling function