Reads a microdata dataset downloaded from the IPUMS Terra extract system.
read_terra_micro(
data_file,
ddi_file = NULL,
data_layer = NULL,
n_max = Inf,
verbose = TRUE,
var_attrs = c("val_labels", "var_label", "var_desc")
)Path to the data file, which can either be the .zip file directly downloaded from the IPUMS Terra website, a path to the unzipped version of that folder, or to the csv unzipped from the download.
(Optional) If the download is unzipped, path to the .xml file which provides usage and citation information for extract.
For .zip extracts with multiple datasets, the name of the
data to load. Accepts a character vector specifying the file name, or
dplyr_select_style conventions. Data layer must uniquely identify
a dataset.
Maximum number of observations to read from the data
Logical, indicating whether to print progress information to console.
Variable attributes to add from the DDI, defaults to
adding all (val_labels, var_label and var_desc). See
set_ipums_var_attributes for more details.
read_terra_micro returns a tbl_df with the tabular data. Use
read_ipums_sf or read_ipums_sp to read shape
data out of a microdata Terra extract.
Other ipums_read:
read_ipums_micro_chunked(),
read_ipums_micro_yield(),
read_ipums_micro(),
read_ipums_sf(),
read_nhgis(),
read_terra_area(),
read_terra_raster()
# NOT RUN {
data <- read_terra_micro("2553_bundle.zip")
# }
Run the code above in your browser using DataLab