usa_extract <- define_extract_micro(
collection = "usa",
description = "2013-2014 ACS Data",
samples = c("us2013a", "us2014a"),
variables = c("SEX", "AGE", "YEAR")
)
if (FALSE) {
submitted_extract <- submit_extract(usa_extract)
downloadable_extract <- wait_for_extract(submitted_extract)
# For microdata, the path to the DDI .xml codebook file is provided.
usa_xml_file <- download_extract(downloadable_extract)
# Load with a `read_ipums_micro_*()` function
usa_data <- read_ipums_micro(usa_xml_file)
# You can also download previous extracts with their collection and number:
nhgis_files <- download_extract("nhgis:1")
# NHGIS extracts return a path to both the tabular and spatial data files,
# as applicable.
nhgis_data <- read_nhgis(data = nhgis_files["data"])
# Load NHGIS spatial data
nhgis_geog <- read_ipums_sf(data = nhgis_files["shape"])
}
Run the code above in your browser using DataLab