Learn R Programming

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

ipumsr

The ipumsr package helps import IPUMS extracts from the IPUMS website into R. IPUMS provides census and survey data from around the world integrated across time and space. IPUMS integration and documentation makes 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.

The ipumsr package can be installed by running the following command:

install.packages("ipumsr")

Or, you can install the development version using the following commands:

if (!require(devtools)) install.packages("devtools")

devtools::install_github("ipums/ipumsr")

Learning More

The vignettes are a great place to learn more about ipumsr and IPUMS data:

  • See the ipums vignette for a general introduction

  • For a more detailed look at some of the features, see these vignettes:

    • value-labels
      • Provides guidance for using the value labels provided by IPUMS
    • ipums-geography
      • Provides guidance for using R as GIS tool with IPUMS data
    • ipums-bigdata
      • How to handle large IPUMS data extracts and examples of using the chunked versions of microdata reading functions.
    • ipums-api
      • How to use the IPUMS microdata extract API to define and submit extract requests, check extract status, and download extract files
  • Or to see examples of how to work through data from particular projects, see these vignettes:

    • ipums-cps
      • An example of using CPS data with the ipumsr package
    • ipums-nhgis
      • An example of using NHGIS data with the ipumsr package
    • ipums-terra
      • An example of using IPUMS Terra data with the ipumsr package
    • The IPUMS website
      • For more project specific exercises

You can access them from R with the vignette() command (eg vignette("value-labels")).

If you are installing from github and want the vignettes, you’ll need to run the following commands first:

devtools::install_github("ipums/ipumsr/ipumsexamples")
devtools::install_github("ipums/ipumsr", build_vignettes = TRUE)

Development

We greatly appreciate bug reports, suggestions or pull requests. They can be submitted via github, on our user forum or by email to ipums@umn.edu

Before contributing, please be sure to read the Contributing Guidelines and the Code of Conduct.

Copy Link

Version

Install

install.packages('ipumsr')

Monthly Downloads

3,403

Version

0.5.2

License

Mozilla Public License 2.0

Issues

Pull Requests

Stars

Forks

Maintainer

Derek Burk

Last Published

December 9th, 2022

Functions in ipumsr (0.5.2)

ipums_conditions

Get IPUMS citation and conditions
ipums_data_collections

List IPUMS data collections
extract_list_to_tbl

Convert a list of extract definitions to a tibble
extract_tbl_to_list

Convert a tibble of extract definitions to a list
ipums_example

Get path to ipums example datasets
ipums_extract-class

ipums_extract class
ipums_bind_rows

Bind rows together, but preserve labelled class attributes
get_recent_extracts_info

Get information on recent extracts
ipums_list_files

List files available for analysis in an IPUMS extract
ipums_var_info

Get IPUMS variable information
ipums_file_info

Get IPUMS file information
ipums_shape_left_join

Join data to geographic boundaries
lbl_add

Add labels for unlabelled values
lbl_na_if

Set labelled values to missing
read_ipums_sf

Read boundary files from an IPUMS extract
lbl_clean

Clean unused labels
lbl_relabel

Relabel labelled values
make_ddi_from_scratch

Create DDI structure (for internal use)
read_nhgis

Read data from an NHGIS extract
zap_ipums_attributes

Remove all IPUMS attributes from a variable (or all variables in a data.frame)
ipums_view

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

Read data from an IPUMS extract
read_ipums_ddi

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

Launch a browser window to the ipums website
read_ipums_codebook

Read metadata from a text codebook in a NHGIS or Terra area-level extract
wait_for_extract

Wait for extract to finish
submit_extract

Submit an extract request via the IPUMS API
join_failures

Report on observations dropped by a join
read_terra_raster

Read data from an IPUMS Terra raster extract
reexports

Objects exported from other packages
set_ipums_var_attributes

Add IPUMS variable attributes to a data.frame
set_ipums_api_key

Set your IPUMS API key
lbl_define

Define labels for an unlabelled vector
lbl

Make a label placeholder object
lbl_collapse

Collapse labelled values to labels that already exist
ipums_callback

Callback classes
ipums_collect

Collect data into R session with IPUMS attributes
read_terra_area

Read data from an IPUMS Terra area extract
is_extract_ready

Is the extract ready to download?
ipumsr-package

ipumsr: Read 'IPUMS' Extract Files
read_terra_micro

Read data from an IPUMS Terra microdata extract
read_ipums_micro_chunked

Read data from an IPUMS extract (in chunks)
save_extract_as_json

Save an ipums_extract to disk as JSON
remove_from_extract

Remove values from an IPUMS USA or CPS extract
read_ipums_micro_yield

Read data from an IPUMS extract (in yields)
get_extract_info

Get information about a submitted extract
define_extract_from_json

Create an ipums_extract object from a JSON-formatted definition
add_to_extract

Add values to an IPUMS USA or CPS extract
dplyr_select_style

Select-style helpers from dplyr
download_extract

Download an IPUMS data extract
define_extract_cps

Define an IPUMS CPS extract request
define_extract_usa

Define an IPUMS USA extract request
get_last_extract_info

Get information on last extract