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.
read_ipums_ddi(ddi_file, data_layer = NULL, lower_vars = FALSE)
Filepath to DDI xml file
If ddi_file is an extract with multiple DDIs, dplyr
select
-style notation indicating which .xml data
layer to load.
Logical indicating whether to convert variable names to lowercase (default is FALSE, in line with IPUMS conventions)
An ipums_ddi
object with metadata information.
Other ipums_metadata:
read_ipums_codebook()
# Example extract DDI
ddi_file <- ipums_example("cps_00006.xml")
ddi <- read_ipums_ddi(ddi_file)