zap_everything: Remove all SPSS-related information from a data frame

View source: R/zap_everything.R

zap_everythingR Documentation

Remove all SPSS-related information from a data frame

Description

haven::read_sav can be used to read.sav and .zsav files into R. It preserves SPSS-related information such as labels and attributes, which can be removed individually using haven's zap_* functions. zap_everything combines the majority of these into a single wrapper function.

Usage

zap_everything(df)

Arguments

df

A data.frame.

Details

zap_everything combines the following haven::zap_* functions:

  • zap_label - to remove variable labels;

  • zap_labels - to remove value labels;

  • zap_formats - to remove format attributes;

  • zap_widths - to remove display width attributes;

  • zap_empty - to convert empty strings within character columns into missing values.

Examples

x <- haven::read_sav(system.file("examples", "iris.sav", package = "haven"))
zap_everything(x)


jackhannah95/jafun documentation built on Feb. 9, 2023, 12:24 p.m.