Learn R Programming

⚠️There's a newer version (0.8.2) of this package.Take me there.

ipumsr

ipumsr provides an R interface for handling IPUMS data, allowing users to:

  • Easily read files downloaded from the IPUMS extract system

  • Request data, download files, and get metadata from certain IPUMS collections

  • Interpret and process data using the contextual information that is included with many IPUMS files

Installation

To install the package from CRAN, use

install.packages("ipumsr")

To install the development version of the package, use

remotes::install_github("ipums/ipumsr")

What is IPUMS?

IPUMS is the world’s largest publicly available population database, providing census and survey data from around the world integrated across time and space. IPUMS integration and documentation make it easy to study change, conduct comparative research, merge information across data types, and analyze individuals within family and community context. Data and services are available free of charge.

IPUMS consists of multiple projects, or collections, that provide different data products.

  • Microdata projects distribute data for individual survey units, like people or households.
  • Aggregate data projects distribute summary tables of aggregate statistics for particular geographic units along with corresponding GIS mapping files.

ipumsr supports different levels of functionality for each IPUMS project:

Project / CollectionData TypeDescriptionRead Data ExtractsRequest & Download DataGet Metadata
IPUMS USAMicrodataU.S. Census and American Community Survey microdata (1850-present)XX
IPUMS CPSMicrodataCurrent Population Survey microdata including basic monthly surveys and supplements (1962-present)XX
IPUMS InternationalMicrodataCensus microdata covering over 100 countries, contemporary and historicalXX
IPUMS NHGISAggregate DataTabular U.S. Census data and GIS mapping files (1790-present)XXX
IPUMS IHGISAggregate DataTabular and GIS data from population, housing, and agricultural censuses around the world
IPUMS Time UseMicrodataTime use microdata from the U.S. (1930-present) and thirteen other countries (1965-present)X
IPUMS Health SurveysMicrodataMicrodata from the U.S. National Health Interview Survey (NHIS) (1963-present) and Medical Expenditure Panel Survey (MEPS) (1996-present)X
IPUMS Global HealthMicrodataHealth survey microdata for low- and middle-income countries, including harmonized data collections for Demographic and Health Surveys (DHS) and Performance Monitoring for Action (PMA) surveysX
IPUMS Higher EdMicrodataSurvey microdata on the science and engineering workforce in the U.S. from 1993 to 2013X

ipumsr uses the IPUMS API to submit data requests, download data extracts, and get metadata, so the scope of ipumsr functionality generally corresponds to the available API functionality. As the IPUMS team extends the API to support more functionality for more projects, we aim to extend ipumsr capabilities accordingly.

Getting started

If you’re new to IPUMS data, learn more about what’s available through the IPUMS Projects Overview.

For an overview of how to find, request, download, and read IPUMS data into R, see IPUMS Data and R.

To learn how ipumsr interfaces with the IPUMS extract system via the IPUMS API, see the Introduction to the IPUMS API for R Users.

Additional demonstration vignettes are also available as Articles on the package website or by using the vignette() function in R (e.g. vignette("ipums-read", package = "ipumsr")). These include vignettes for accessing microdata and NHGIS data and metadata via the API.

The IPUMS support website also houses many project-specific R-based training exercises. (As of September 2023, these exercises have not yet been updated to incorporate the major API data and metadata access capabilities added to ipumsr in version 0.6.0.)

Related work

  • The survey and srvyr packages can help you incorporate IPUMS survey weights into your analysis for various survey designs.

  • See haven for more information about value labels and labelled vectors

  • hipread underlies the hierarchical file reading functions in ipumsr

Getting help + contributing

We greatly appreciate feedback and development contributions. Please submit any bug reports, pull requests, or other suggestions on GitHub. Before contributing, please be sure to read the Contributing Guidelines and the Code of Conduct.

If you have general questions or concerns about IPUMS data, check out our user forum or send an email to ipums@umn.edu.

Copy Link

Version

Install

install.packages('ipumsr')

Monthly Downloads

3,403

Version

0.6.3

License

Mozilla Public License 2.0

Issues

Pull Requests

Stars

Forks

Maintainer

Derek Burk

Last Published

September 1st, 2023

Functions in ipumsr (0.6.3)

ipums_collect

Collect data into R session with IPUMS attributes
ipums_ddi-class

ipums_ddi class
ipums_bind_rows

Bind multiple data frames by row, preserving labelled attributes
ipums_example

Get path to IPUMS example datasets
get_extract_info

Retrieve the definition and latest status of an extract request
get_sample_info

List available samples for IPUMS microdata collections
ipums_data_collections

List IPUMS data collections
get_recent_extracts_info_list

Get information on recent extracts
ipums_callback

Callback classes
ipums_var_info

Get contextual information about variables in an IPUMS data source
ipums_shape_join

Join tabular data to geographic boundaries
ipumsr-package

ipumsr: An R Interface for Downloading, Reading, and Handling IPUMS Data
ipums_file_info

Get file information for an IPUMS extract
ipums_extract-class

ipums_extract class
join_failures

Report on observations dropped during a join
ipums_view

View a static webpage with variable information from a IPUMS extract
ipums_website

Launch a browser window to an IPUMS metadata page
get_metadata_nhgis

List available data sources from IPUMS NHGIS
read_ipums_micro

Read data from an IPUMS microdata extract
read_ipums_ddi

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

Create an ipums_ddi object
ipums_list_files

List files contained within a zipped IPUMS extract
lbl_relabel

Modify value labels for a labelled vector
ipums_list_data

List files available for analysis in an IPUMS extract.
lbl_na_if

Convert labelled data values to NA
read_ipums_codebook

Read metadata from an IPUMS Terra extract codebook file
lbl_clean

Clean unused labels
lbl_define

Define labels for an unlabelled vector
lbl

Make a label placeholder object
lbl_add

Add labels for unlabelled values
read_nhgis

Read tabular data from an NHGIS extract
read_ipums_sp

Read boundary (GIS) files from an IPUMS extract
read_ipums_sf

Read spatial data from an IPUMS extract
read_nhgis_sf

Read and combine tabular and spatial data from an NHGIS extract
read_terra_micro

Read data from an IPUMS Terra microdata extract
read_nhgis_codebook

Read metadata from an NHGIS codebook (.txt) file
read_terra_raster

Read data from an IPUMS Terra raster extract
read_ipums_micro_yield

Read data from an IPUMS microdata extract in yields
save_extract_as_json

Store an extract definition in JSON format
selection_language

tidyselect selection language in ipumsr
read_ipums_micro_chunked

Read data from an IPUMS microdata extract by chunk
remove_from_extract.micro_extract

Remove values from an existing extract definition for an IPUMS microdata project
set_ipums_var_attributes

Add IPUMS variable attributes to a data frame
submit_extract

Submit an extract request via the IPUMS API
read_terra_area

Read data from an IPUMS Terra area extract
zap_ipums_attributes

Remove label attributes from a data frame or labelled vector
remove_from_extract.nhgis_extract

Remove values from an existing NHGIS extract definition
var_spec

Create variable and sample specifications for IPUMS microdata extract requests
wait_for_extract

Wait for an extract request to finish processing
set_ipums_default_collection

Set your default IPUMS collection
set_ipums_api_key

Set your IPUMS API key
reexports

Objects exported from other packages
remove_from_extract

Remove values from an existing IPUMS extract definition
get_extract_history

Browse definitions of previously submitted extract requests
extract_tbl_to_list

Convert recent extract definitions from tibble to list format
download_extract

Download a completed IPUMS data extract
define_extract-micro

Define an extract request for an IPUMS microdata collection
define_extract_nhgis

Define an IPUMS NHGIS extract request
ds_spec

Create dataset and time series table specifications for IPUMS NHGIS extract requests
add_to_extract_micro

Add values to an existing extract definition for an IPUMS microdata collection
add_to_extract.nhgis_extract

Add values to an existing IPUMS NHGIS extract definition
define_extract

Define an IPUMS extract object
add_to_extract

Add values to an existing IPUMS extract definition