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.




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


A variable or data.frame

See also

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


cps <- read_ipums_micro(ipums_example("cps_00006.xml"))
#> Use of data from IPUMS-CPS is subject to conditions including that users should
#> cite the data appropriately. Use command `ipums_conditions()` for more details.
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")