| Type: | Package |
| Title: | Reproducible Retrieval of Pew Research Center Datasets |
| Version: | 0.3.2 |
| Date: | 2021-04-03 |
| URL: | https://github.com/fsolt/pewdata |
| BugReports: | https://github.com/fsolt/pewdata/issues |
| Description: | Reproducible, programmatic retrieval of survey datasets from the Pew Research Center. |
| License: | MIT + file LICENSE |
| LazyData: | FALSE |
| Encoding: | UTF-8 |
| Suggests: | knitr, rmarkdown |
| VignetteBuilder: | knitr |
| Imports: | RSelenium, foreign, magrittr, purrr, rio, stringr, tools,utils |
| RoxygenNote: | 7.1.1 |
| NeedsCompilation: | no |
| Packaged: | 2021-04-08 18:44:49 UTC; fredsolt |
| Author: | Frederick Solt [aut, cre], Yue Hu [aut], Eric Persson [ctb] |
| Maintainer: | Frederick Solt <frederick-solt@uiowa.edu> |
| Repository: | CRAN |
| Date/Publication: | 2021-04-08 19:10:02 UTC |
Download datasets from the Pew Research Center
Description
pew_download provides a programmatic and reproducible means to download survey datasets from the Pew Research Center
Usage
pew_download( area = "politics", file_id, email = getOption("pew_email"), password = getOption("pew_password"), reset = FALSE, download_dir = "pew_data", msg = TRUE, convert = TRUE, delay = 3)Arguments
area | One of the seven research areas of the Pew Research Center (see details). |
file_id | The unique identifier (or optionally a vector of these identifiers)for the dataset(s) to be downloaded (see details). |
email,password | Account information to submit to Pew Research Center (see details). |
reset | If TRUE, the register information will be reset. The default is FALSE. |
download_dir | The directory (relative to your working directory) towhich files from the Pew Research Center will be downloaded. |
msg | If TRUE, outputs a message showing which data set is being downloaded. |
convert | If TRUE, converts downloaded file(s) to .RData format. |
delay | If the speed of your connection to the Pew Data Center is particularly slow, |
Details
The Pew Research Center has seven areas of research focus. Pass one of the following strings to thearea argument to specify which area generatedthe datasets you want to download:
politics U.S. Politics & Policy (the default)
journalism Journalism & Media
socialtrends Social & Demographic Trends
religion Religion & Public Life
internet Internet & Technology
science Science & Society
hispanic Hispanic Trends
global Global Attitudes & Trends
To avoid requiring others to edit your scripts to insert their own contact information, the default is set to fetch this information from the user's .Rprofile. Before runningpew_download, then, you should be sure toadd these options to your .Rprofile substituting your info for the example below:
options("pew_email" = "jherrera@uppermidwest.edu" "pew_password" = "password123!")
Value
The function downloads files.
Examples
## Not run: pew_download(file_id = c("september-2018-political-survey", "june-2018-political-survey"))## End(Not run)