Update existing variables or create new ones that replace existing values with more informative labels as in factor(). All modifications are performed by reference (see data.table::set() for more information about assignment by reference).
labels: A list of named vectors containing the values and labels of variables. The elements of each vector are the values of a variable and the names are the labels. The names of the list are the names of the variables. See the output returned by get_labels() for an example.
new_names: A character vector of the same length as labels where each element denotes the name of a new variable to create for the corresponding element in labels. If NULL, then the variables in labels
are modified and no new variables are created; otherwise, the existing variables are not modified and new variables are created instead.
as_factor: If TRUE factor variables are created; otherwise character vectors are created.
Returns
x is modified by reference and returned invisibly.