ll_labelled {zmisc} | R Documentation |
Create a labelled variable
Description
The labelled_light (ll) collection is a minimal implementation of core
functions for creating and managing haven_labelled
variables, and with
minimal dependencies. These functions, prefixed with ll_
rely only on base
R, and operate only on objects of type haven_labelled
. All functions check
internally that the variables have the correct class and the correct
structure for labelled variables, satisfying the (minimal) specification
inherent in the parameter documentation of the haven::labelled()
function.
The constructor, ll_labelled()
, creates a labelled variable satisfying that
specification.
Usage
ll_labelled(x = double(), labels = NULL, label = NULL)
Arguments
x |
A vector to label. Must be either numeric (integer or double) or character. |
labels |
A named vector or |
label |
A short, human-readable description of the vector. |
Value
A valid labelled variable.
See Also
Other labelled light:
ll_assert_labelled()
,
ll_to_character()
,
ll_val_labels()
,
ll_var_label()
,
threadbare()