lama_translate()
and lama_translate_()
Function that applies some general checks to the arguments of lama_translate()
and lama_translate_()
check_arguments(.data, dictionary, col_new, keep_order, to_factor,
err_handler)
Either a data frame, a factor or an atomic vector.
A lama_dictionary object, holding the translations for various variables.
Only used if .data
is a data frame. The argument col
must be
a character vector of the same length as translation
holding
the names under which the relabeled variables should be stored in
the data.frame. If omitted, then it will be assumed that the new column
names are the same as the column names of the original variables.
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 the vector has
the same length as the number of arguments in ...
, then the
to each variable translation there is a corresponding boolean configuration.
If a translated variable in the data.frame is a factor variable,
and the corresponding boolean configuration is set to TRUE
, then the
the order of the original factor variable will be preserved.
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 the vector has
the same length as the number of arguments in ...
, then the
to each variable translation there is a corresponding boolean configuration.
If to_factor
is TRUE
, then the resulting labeled
variable will be a factor. If to_factor
is set to FALSE
, then
the resulting labeled variable will be a plain character vector.
An error handling function