read_ipums_ddi: Read metadata about an IPUMS extract from a DDI (.xml) file

View source: R/ddi_read.r

read_ipums_ddiR Documentation

Read metadata about an IPUMS extract from a DDI (.xml) file

Description

Reads the metadata about an IPUMS extract from a DDI file into R. Includes information about variable and value labels, terms of usage for the data and positions for the fixed-width file.

Usage

read_ipums_ddi(ddi_file, data_layer = NULL, lower_vars = FALSE)

Arguments

ddi_file

Filepath to DDI xml file

data_layer

If ddi_file is an extract with multiple DDIs, dplyr select-style notation indicating which .xml data layer to load.

lower_vars

Logical indicating whether to convert variable names to lowercase (default is FALSE, in line with IPUMS conventions)

Value

An ipums_ddi object with metadata information.

See Also

Other ipums_metadata: read_ipums_codebook()

Examples

# Example extract DDI
ddi_file <- ipums_example("cps_00006.xml")
ddi <- read_ipums_ddi(ddi_file)

mnpopcenter/ipumsr documentation built on Sept. 30, 2022, 6:56 a.m.