ipums_ddi-class | R Documentation |
ipums_ddi
classThe ipums_ddi
class provides a data structure for storing the metadata
information contained in IPUMS codebook files. These objects are primarily
used when loading IPUMS data, but can also be
used to explore metadata for an IPUMS extract.
For microdata projects, this information is provided in DDI codebook (.xml) files.
For NHGIS, this information is provided in .txt codebook files.
The codebook file contains metadata about the extract files themselves, including file name, file path, and extract date as well as information about variables present in the data, including variable names, descriptions, data types, implied decimals, and positions in the fixed-width files.
This information is used to correctly parse IPUMS fixed-width files and attach additional variable metadata to data upon load.
Note that codebook metadata for NHGIS extracts can also be stored in
an ipums_ddi
object, even though these codebooks are distributed as .txt
files, not .xml files. These files do not adhere to the same standards as
the DDI codebook files, so some ipums_ddi
fields will be left blank when
reading NHGIS codebooks.
ipums_ddi
object To create an ipums_ddi
object from an IPUMS microdata extract, use
read_ipums_ddi()
.
To create an ipums_ddi
object from an IPUMS NHGIS extract, use
read_nhgis_codebook()
To load the data associated with an ipums_ddi
object, use
read_ipums_micro()
, read_ipums_micro_chunked()
, or
read_ipums_micro_yield()
Use ipums_var_info()
to explore variable-level metadata for the variables
included in a dataset.
Use ipums_file_info()
to explore file-level metadata for an extract.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.