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
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.