-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
77 lines (56 loc) · 3.05 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# rgesis
<!-- badges: start -->
[](https://github.com/jslth/rgesis/actions/workflows/R-CMD-check.yaml)
[](https://github.com/jslth/rgesis/actions/workflows/rhub.yaml)
[](https://CRAN.R-project.org/package=rgesis)
[](https://www.repostatus.org/#active)
[](https://app.codecov.io/gh/JsLth/rgesis?branch=main)
[](https://www.codefactor.io/repository/github/jslth/rgesis/overview/main)
<!-- badges: end -->
`{rgesis}` provides a simple, programmatic and reproducible interface to the GESIS search engine. It allows the retrieval of metadata on records like research datasets, variables, publications, and tools. Based on this, the package can also download survey data from the data archive.
Note that while the GESIS search API can be accessed directly, you need to be logged in to download any survey data. You can create a user account [here](https://login.gesis.org/realms/gesis/login-actions/registration?client_id=js-login). `{rgesis}` takes over continuous credentials management and OAuth authentication using the [`{keyring}`](https://keyring.r-lib.org/) and [`{httr2}`](https://httr2.r-lib.org/) packages.
## Installation
You can install the development version of rgesis from [GitHub](https://github.com/) with:
``` r
# install.packages("pak")
pak::pkg_install("jslth/rgesis")
```
## Example
`{rgesis}` can be used to search for research data
```{r search-data}
library(rgesis)
gesis_search("allbus", type = "research_data")
```
... or other things from the social sciences, like publications.
```{r}
gesis_search("climate change", type = "publication")
```
The results include metadata in complex data structures -- or simplified to a tidy rectangular shape.
```{r}
gesis_search(tidy = TRUE)
```
Metadata records can also be used to download survey data directly from the data archive. You need to be logged in, though.
```{r, eval=FALSE}
# gesis_auth()
sav_file <- gesis_data("ZA5272", select = "\\.sav")
haven::read_sav(sav_file)
```
# Related packages
- [`{gesisdata}`](https://fsolt.org/gesisdata/) provides access to the GESIS data archive using web browser automation
- [`{mannheim}`](https://github.com/sumtxt/mannheim) and [`{gesis}`](https://github.com/expersso/gesis) provide direct API access but are outdated and do not account for the full capabilities of the search engine