Removes 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,
replacing all with NAs.
This function removes value labels; use zap_label() to remove variable
labels.
zap_labels(x)
| x | A vector or data frame |
|---|
Other zappers: zap_empty,
zap_formats, zap_label,
zap_widths
#> <Labelled integer> #> [1] 1 2 3 4 5 #> #> Labels: #> value label #> 1 good #> 5 badzap_labels(x1)#> [1] 1 2 3 4 5#> <Labelled SPSS double> #> [1] 1 2 3 4 9 #> Missing values: 9 #> #> Labels: #> value label #> 1 good #> 5 badzap_labels(x2)#> [1] 1 2 3 4 NA#> # A tibble: 5 x 2 #> x1 x2 #> <int+lbl> <dbl+lbl> #> 1 1 [good] 1 [good] #> 2 2 2 #> 3 3 3 #> 4 4 4 #> 5 5 [bad] 9 (NA)zap_labels(df)#> # A tibble: 5 x 2 #> x1 x2 #> <int> <dbl> #> 1 1 1 #> 2 2 2 #> 3 3 3 #> 4 4 4 #> 5 5 NA