View source: R/labelled_light.R
ll_to_character | R Documentation |
Returns a character representation of a labelled variable, using the value labels to look up the label for a given value.
The default behavior of this function is similar to
labelled::to_character()
. The options, however, are slightly different.
Most importantly, instead of specifying NA
handling using parameters, the
function relies on the default
parameter to determine what happens for
unlabelled variables, allowing users to specify including the original values
of x
instead of the labels, returning NA
, or returning a specific string
value. Also, the default behavior is to drop any variable label attribute, in
line with the default as.character()
method.
ll_to_character(x, default = x, preserve_var_label = FALSE)
x |
A labelled variable |
default |
Vector providing a default label for any values not found in
the |
preserve_var_label |
Should any |
Other labelled light:
ll_assert_labelled()
,
ll_labelled()
,
ll_val_labels()
,
ll_var_label()
,
threadbare()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.