file <- ipums_example("nhgis0712_csv.zip")
d1 <- read_nhgis(
file,
file_select = 1,
verbose = FALSE
)
d2 <- read_nhgis(
file,
file_select = 2,
verbose = FALSE
)
# Variables have associated label attributes:
ipums_var_label(d1$PMSAA)
# Preserve labels when binding data sources:
d <- ipums_bind_rows(d1, d2)
ipums_var_label(d$PMSAA)
# dplyr `bind_rows()` drops labels:
d <- dplyr::bind_rows(d1, d2)
ipums_var_label(d$PMSAA)
Run the code above in your browser using DataLab