Setup 
Internal code for setup of the snowball search.
Show the code 
library (bibtex)library (openalexR) 
Thank you for using openalexR!
To acknowledge our work, please cite the package by calling `citation("openalexR")`.
To suppress this message, add `openalexR.message = suppressed` to your .Renviron file. 
Show the code 
library (writexl)library (tibble)library (dplyr) 
Attaching package: 'dplyr' 
The following objects are masked from 'package:stats':
    filter, lag 
The following objects are masked from 'package:base':
    intersect, setdiff, setequal, union 
Show the code 
 
Loading required package: ggplot2 
Show the code 
 
Attaching package: 'tidygraph' 
The following object is masked from 'package:stats':
    filter 
Show the code 
if  (! require ("IPBES.R" )){install.packages ("IPBES.R" , repos =  c ('https://ipbes-data.r-universe.dev' , 'https://cloud.r-project.org' ) 
Loading required package: IPBES.R 
Warning: replacing previous import 'DT::JS' by 'networkD3::JS' when loading
'IPBES.R' 
Show the code 
# library(ggplot2) # library(knitr) <-  bibtex:: read.bib ("./key-paper.bib" )<-  sapply (function (x) {$ doi 
 
 
Searches 
Searches are conducted with the OpenAlex  API. The API is documented here .
Setup OpenAlex  usage and do snowball serarch 
Show the code 
<-  file.path  ("data" , "key_works.rds" )if  (exists (fn)){<-  readRDS (fn)else  {<-  oa_fetch (entity =  "works" ,doi =  dois,verbose =  FALSE <-  openalexR::: shorten_oaid (key_works$ id)<-  file.path ("data" , "snowball.rds" )if  (file.exists (fn)) {<-  readRDS (fn)else  {<-  oa_snowball (identifier =  ids,verbose =  FALSE saveRDS (snowball, fn)<-  snowball2df (snowball) |> :: as_tibble ()<-  list (c (cit =  "Fisher et al. 2022" , id =  "W4220786370" ),c (cit =  "Patterson et al. 2017" , id =  "W2520670351" ),c (cit =  "Feola et al. 2015" , id =  "W2020319093" ),c (cit =  "Loorbach et al. 2017" , id =  "W2204133637" ),c (cit =  "Scoones et al. 2020" , id =  "W3001406994" ),c (cit =  "Evans et al. 2023" , id =  "W4379647013" ) 
 
 
Supplemented edges between all papers 
Show the code 
<-  file.path ("data" , "snowball_supplemented.rds" )if  (file.exists (fn)) {<-  readRDS (fn)else  {<-  tibble (from =  character (0 ),to =  character (0 )<-  snowball$ nodes$ idfor  (i in  1 : nrow (snowball$ nodes)) {<-  works[[i]]<-  gsub ("https://openalex.org/" , "" , snowball$ nodes$ referenced_works[[i]])<-  to[to %in%  works]if  (length (to_in_works) >  0 ) {<-  add_row (tibble (from =  from,to =  to_in_works<-  snowball$ edges <-  add_row (snowball_supplemented$ edges, new_edges) |> distinct ()saveRDS (snowball_supplemented, fn) 
 
 
 
Results 
Number of papers cited by keypapers 
Show the code 
<-  key_works_cit |> simplify2array ()<-  x["cit" , ]names (keypapers) <-  x["id" , ]rm (x)$ edges |> filter (from %in%  names (keypapers)) |> unique () |> mutate (cit =  unlist (keypapers[from])|> select (cit) |> table () |> as.data.frame () |> arrange (desc (Freq)) |> :: kable (col.names =  c ("Key paper" , "Number of papers" ),caption =  "Number of papers cited by Keypapers in the snowball search"   
Number of papers cited by Keypapers in the snowball search 
 
Loorbach et al. 2017 
123 
 
Patterson et al. 2017 
75 
 
Scoones et al. 2020 
65 
 
Feola et al. 2015 
64 
 
Fisher et al. 2022 
57 
 
Evans et al. 2023 
55 
 
 
 
Show the code 
$ edges |> filter (to %in%  names (keypapers)) |> unique () |> mutate (cit =  unlist (keypapers[to]),|> select (cit) |> table () |> as.data.frame () |> arrange (desc (Freq)) |> :: kable (col.names =  c ("Key paper" , "Number of papers" ),caption =  "No of papers citing the Keypapers in the snowball search"   
No of papers citing the Keypapers in the snowball search 
 
Loorbach et al. 2017 
701 
 
Patterson et al. 2017 
495 
 
Feola et al. 2015 
398 
 
Scoones et al. 2020 
270 
 
Fisher et al. 2022 
16 
 
Evans et al. 2023 
2 
 
 
 
 
 
Save snowball as Excel file 
Show the code 
<-  file.path ("." , "data" , "snowball_excel.xlsx" )if  (! file.exists (fn)){:: to_xlsx (snowball, fn) 
 
To download the Excsl file with all references, plese click here .
 
Graph of links between references 
Show the code 
#| <-  list.files ("figures" , pattern =  "snowball_cited" , full.names =  TRUE ) |> length () if  (no !=  4 ){$ nodes$ cited_by_count_by_year <-  snowball$ nodes$ cited_by_count /  (2024  -  snowball$ nodes$ publication_year)<-  snowballfor   (i in  seq_along (key_works_cit)) {$ nodes$ id[snowball_p$ nodes$ id %in%  key_works_cit[[i]]["id" ]] <-  key_works_cit[[i]]["cit" ]$ edges$ from[snowball_p$ edges$ from %in%  key_works_cit[[i]]["id" ]] <-  key_works_cit[[i]]["cit" ]$ edges$ to[snowball_p$ edges$ to %in%  key_works_cit[[i]]["id" ]] <-  key_works_cit[[i]]["cit" ]:: plot_snowball (snowball_p, name =  "snowball" , path =  "figures" )rm (snowball_p)