Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

zap_label

Zap label


Description

Removes label, leaving unlabelled vectors as is. Use this if you want to simply drop all label attributes from a data frame.

This function removes variable labels; use zap_labels() to remove value labels.

Usage

zap_label(x)

Arguments

x

A vector or data frame

See Also

Other zappers: zap_empty(), zap_formats(), zap_labels(), zap_widths()

Examples

x1 <- labelled(1:5, c(good = 1, bad = 5))
x1
zap_label(x1)

x2 <- labelled_spss(c(1:4, 9), c(good = 1, bad = 5), na_values = 9)
x2
zap_label(x2)

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

haven

Import and Export 'SPSS', 'Stata' and 'SAS' Files

v2.4.1
MIT + file LICENSE
Authors
Hadley Wickham [aut, cre], Evan Miller [aut, cph] (Author of included ReadStat code), RStudio [cph, fnd]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.