zap_stata: Remove all Stata dataset attributes from a data frame

View source: R/zap_stata.R

zap_stataR Documentation

Remove all Stata dataset attributes from a data frame

Description

zap_stata() removes all Stata dataset attributes from a data frame created via haven::read_dta(). This function is meant to cut down on repetitive code associated with importing a DTA file when a CSV file is not readily available. The name of this function is a nod to the ⁠haven::zap_*()⁠ functions.

Usage

zap_stata(df)

Arguments

df

A data frame.

Details

More specifically, zap_stata():

  • Removes any value labels and converts any tagged missing values to NA.

  • Removes any variable labels or formats.

  • Removes the dataset label.

  • Removes any dataset notes.

Value

A data frame.


CenterOnBudget/Rcbpp documentation built on Jan. 6, 2025, 9:32 p.m.