Reproducible Retrieval of Pew Research Center Datasets

Reproducible, programmatic retrieval of survey datasets from the Pew Research Center.

CRAN version Travis-CI Build Status

pewdata is an R package that provides reproducible, programmatic access to survey datasets from the Pew Research Center.

To install:

  • the latest released version: install.packages("pewdata")
  • the latest development version:
if (!require(ghit)) install.packages("ghit")

Note that pewdata depends on the Chrome Dev browser; if you don't already have it installed on your machine, get it here.

For more details, check out the vignette.


Version 0.3.0

  1. Works with the revised Pew Research Center website, which necessitated a switch back to RSelenium from rvest.
  2. By default, automatically converts downloaded datafiles to .RData format.

Version 0.2.0

  1. Faster
    • Revised the function to be more compact with the rvest functions.
    • Replaced the if-else if chains with the switch statements.
    • Overwrote the for loop by a sapply function.
  2. More user-friendly
    • Users do not need to set up the .Rprofile by themselves. If the information is missing the function will automatically call an input request at the terminal to ask for required information for the downloading.
    • Users can reset the register information stored in the .Rprofile by switching the argument reset to TRUE.
    • The function no longer relies on the Firefox browser.

Version 0.1.1

Allows nested directories to be automatically created if necessary if specified using the download_dir argument

Version 0.1.0

First release.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.3.2 by Frederick Solt, 9 months ago

Report a bug at

Browse source code at

Authors: Frederick Solt [aut, cre] , Yue Hu [aut] , Eric Persson [ctb]

Documentation:   PDF Manual  

MIT + file LICENSE license

Imports RSelenium, foreign, magrittr, purrr, rio, stringr, tools, utils

Suggests knitr, rmarkdown

See at CRAN