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"))

Arguments

data_file

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.

ddi_file

(Optional) If the download is unzipped, path to the .xml file which provides usage and citation information for extract.

data_layer

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.

n_max

Maximum number of observations to read from the data

verbose

Logical, indicating whether to print progress information to console.

var_attrs

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.

Value

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.

See also

Examples

# NOT RUN {
data <- read_terra_micro("2553_bundle.zip")
# }