zap_ipums_attributes | R Documentation |
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.
zap_ipums_attributes(x)
x |
A variable or a whole data.frame to remove attributes from |
A variable or data.frame
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")) 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.