Learn R Programming

ipumsr (version 0.5.2)

read_ipums_ddi: 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)

Value

An ipums_ddi object with metadata information.

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)

See Also

Other ipums_metadata: read_ipums_codebook()

Examples

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

Run the code above in your browser using DataLab