Strips all label-related attributes from variables, converting
haven_labelled vectors to their base R types (numeric or character).
This is useful when you need plain data without any labelling for
functions or packages that do not support labelled data.
Value
The data with all labelling removed. haven_labelled numeric
vectors become plain double, factors remain factors (but lose their
"label" attribute).
Details
The following attributes are removed:
"label"(variable label)"labels"(value labels)"na_tag_map"(tagged NA mapping)"na_tag_format"(tagged NA format)"na_values","na_range"(SPSS missing value specs)"format.spss","format.stata","format.sas"(format info)
Tagged NAs are converted to regular NA.
See also
strip_tags() for removing only tagged NAs,
to_label() for converting to factors (preserving label info)
Other labels:
copy_labels(),
drop_labels(),
find_var(),
set_na(),
to_character(),
to_label(),
to_labelled(),
to_numeric(),
val_labels(),
var_label()
Examples
if (FALSE) { # \dontrun{
# Remove all labels from entire dataset
data <- read_spss("survey.sav")
data_plain <- unlabel(data)
# Remove labels from specific variables
data <- unlabel(data, gender, life_satisfaction)
} # }
