ipumsr (version 0.6.3)

read_terra_micro: Read data from an IPUMS Terra microdata extract

Description

[Deprecated]

Reads a microdata dataset downloaded from the IPUMS Terra extract system.

Support for IPUMS Terra has been discontinued. This function will be removed in a future release. For general handling of raster data in R, see the terra package.

Usage

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

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.

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 a tidyselect selection. 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.

Examples

Run this code
if (FALSE) {
data <- read_terra_micro("2553_bundle.zip")
}

Run the code above in your browser using DataLab