-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_data.qmd
57 lines (49 loc) · 1.02 KB
/
get_data.qmd
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
---
title: "Get Papers from OpenAlex"
author: "Felix Dietrich, Anisha Arenz, & Leonard Reinecke"
categories:
- "Autonomy"
- "Digital Media"
- "Self-Determination"
---
This is the documentation of the code that was used to scrape all relevant
papers from the OpenAlex API on September 12, 2022.
```{r}
#| label: get data
#| eval: false
# libs
library(tidyverse)
library(openalexR)
# get data
data <-
oa_request(
query_url = "https://api.openalex.org/works?filter=concepts.id:C65414064",
verbose = TRUE
)
# transform list to tibble
test <-
data %>%
oa2df(entity = "works",
verbose = TRUE) %>%
as_tibble()
# reformat
data <- data %>%
rename(
title = TI,
authors = author,
abstract = AB,
venue = SO,
venue_id = SO_ID,
publisher = PU,
url = URL,
open_access = OA,
total_cites = TC,
cites_by_year = TCperYear,
year = PY,
doi = DI,
publication_type = DT,
referenced_works = CR
) %>%
select(-IS, -ids) %>%
relocate(year, .before = pubdata)
```