zap_labels: Zap labels

Description Usage Arguments Note See Also Examples

View source: R/zap_labels.R

Description

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.

Usage

1

Arguments

x

A vector or data frame

Note

This function doesn't remove any label attribute(s), just the labels attribute(s). Use zap_label to remove label attribute(s).

See Also

Other zappers: zap_empty, zap_formats, zap_label, zap_widths

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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)

# zap_labels also works with data frames
df <- tibble::data_frame(x1, x2)
df
zap_labels(df)

tidyverse/haven documentation built on Jan. 11, 2019, 12:13 p.m.