zap_ipums_attributes: Remove all IPUMS attributes from a variable (or all variables...

Description Usage Arguments Value See Also Examples

View source: R/lbl_helpers.r

Description

Helper to remove ipums attributes (including value labels from the labelled class, the variable label and the variable description). These attributes can sometimes get in the way of functions like the dplyr join functions so you may want to remove them.

Usage

1

Arguments

x

A variable or a whole data.frame to remove attributes from

Value

A variable or data.frame

See Also

Other lbl_helpers: lbl_add(), lbl_clean(), lbl_collapse(), lbl_define(), lbl_na_if(), lbl_relabel(), lbl()

Examples

1
2
3
4
5
6
cps <- read_ipums_micro(ipums_example("cps_00006.xml"))
annual_unemployment <- data.frame(YEAR = c(1962, 1963), unemp = c(5.5, 5.7))

# Avoids warning 'Column `YEAR` has different attributes on LHS and RHS of join'
cps$YEAR <- zap_ipums_attributes(cps$YEAR)
cps <- dplyr::left_join(cps, annual_unemployment, by = "YEAR")

ipumsr documentation built on July 22, 2020, 1:06 a.m.