zap_labels | R Documentation |
Removes value labels, leaving unlabelled vectors as is. Use this if you
want to simply drop all labels
from a data frame.
Zapping labels from labelled_spss()
also removes user-defined missing
values by default, replacing with standard NA
s. Use the user_na
argument
to override this behaviour.
zap_labels(x, ...) ## S3 method for class 'haven_labelled_spss' zap_labels(x, ..., user_na = FALSE)
x |
A vector or data frame |
... |
Other arguments passed down to method. |
user_na |
If |
zap_label()
to remove variable labels.
Other zappers:
zap_empty()
,
zap_formats()
,
zap_label()
,
zap_widths()
x1 <- labelled(1:5, c(good = 1, bad = 5)) x1 zap_labels(x1) x2 <- labelled_spss(c(1:4, 9), c(good = 1, bad = 5), na_values = 9) x2 zap_labels(x2) # Keep the user defined missing values zap_labels(x2, user_na = TRUE) # zap_labels also works with data frames df <- tibble::tibble(x1, x2) df zap_labels(df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.