Show the code
#|
kp <- jsonlite::read_json(params$keypapers)
dois <- sapply(
kp,
function(x) {
x$DOI
}
) |>
unlist() |>
unique() |>
as.character()
dois <- dois[!is.null(dois)]Data Management Report
A snowball literature using OpenAlex will be conducted and all steps documented. The literature search is for the finance section of Chapter 6 of the IPBES Business and Biodiversity assessment.
Literature search for BBA Chapter 6 Finance Section
#|
kp <- jsonlite::read_json(params$keypapers)
dois <- sapply(
kp,
function(x) {
x$DOI
}
) |>
unlist() |>
unique() |>
as.character()
dois <- dois[!is.null(dois)]Of the 22 keypapers, 20 have a DOI and can be used for the further search.
Searches are conducted with the OpenAlex API. The API is documented here.
#|
fn <- file.path("data", "key_works.rds")
if (!file.exists(fn)) {
key_works <- oa_fetch(
entity = "works",
doi = dois,
verbose = FALSE
)
saveRDS(key_works, fn)
} else {
key_works <- readRDS(fn)
}
key_works_cit <- IPBES.R::abbreviate_authors(key_works)#|
ids <- openalexR:::shorten_oaid(key_works$id)
fn <- file.path("data", "snowball.rds")
if (file.exists(fn)) {
snowball <- readRDS(fn)
} else {
snowball <- oa_snowball(
identifier = ids,
verbose = FALSE
)
saveRDS(snowball, fn)
}
flat_snow <- snowball2df(snowball) |>
tibble::as_tibble()#|
fn <- file.path("data", "snowball_supplemented.rds")
if (file.exists(fn)) {
snowball_supplemented <- readRDS(fn)
} else {
new_edges <- tibble(
from = character(0),
to = character(0)
)
works <- snowball$nodes$id
for (i in 1:nrow(snowball$nodes)) {
from <- works[[i]]
to <- gsub("https://openalex.org/", "", snowball$nodes$referenced_works[[i]])
to_in_works <- to[to %in% works]
if (length(to_in_works) > 0) {
new_edges <- add_row(
new_edges,
tibble(
from = from,
to = to_in_works
)
)
}
}
snowball_supplemented <- snowball
snowball_supplemented$edges <- add_row(snowball_supplemented$edges, new_edges) |>
distinct()
saveRDS(snowball_supplemented, fn)
}snowball$edges |>
filter(from %in% names(key_works_cit)) |>
unique() |>
mutate(
cit = unlist(key_works_cit[from])
) |>
select(cit) |>
table() |>
as.data.frame() |>
arrange(desc(Freq)) |>
knitr::kable(
col.names = c("Key paper", "Number of papers"),
caption = "Number of papers cited by Keypapers in the snowball search"
)| Key paper | Number of papers |
|---|---|
| Thiemann et al. (2020) | 83 |
| Stellinga (2019) | 67 |
| Baker (2018) | 66 |
| Coombs & Thiemann (2022) | 57 |
| Cassar (2023) | 54 |
| Taylor (2022) | 53 |
| Kranke & Yarrow (2018) | 48 |
| Stellinga & Mügge (2017) | 36 |
| Best (2022) | 31 |
| Lockwood (2014) | 30 |
| Siderius (2022) | 30 |
| Quorning (2023) | 29 |
| Mennillo & Sinclair (2019) | 27 |
| Jackson & Bailey (2023) | 24 |
| Özgöde (2021) | 23 |
| Abreu & Lopes (2021) | 16 |
| Langley & Morris (2020) | 13 |
| Svetlova (2012) | 9 |
snowball$edges |>
filter(to %in% names(key_works_cit)) |>
unique() |>
mutate(
cit = unlist(key_works_cit[to]),
) |>
select(cit) |>
table() |>
as.data.frame() |>
arrange(desc(Freq)) |>
knitr::kable(
col.names = c("Key paper", "Number of papers"),
caption = "No of papers citing the Keypapers in the snowball search"
)| Key paper | Number of papers |
|---|---|
| Goede (2004) | 173 |
| Svetlova (2012) | 70 |
| Baker (2018) | 61 |
| Lockwood (2014) | 56 |
| Stellinga & Mügge (2017) | 27 |
| Stellinga (2019) | 23 |
| Kranke & Yarrow (2018) | 21 |
| Coombs & Thiemann (2022) | 20 |
| Langley & Morris (2020) | 19 |
| Thiemann et al. (2020) | 19 |
| Siderius (2022) | 14 |
| Özgöde (2021) | 8 |
| Best (2022) | 7 |
| Quorning (2023) | 7 |
| Taylor (2022) | 5 |
| Mennillo & Sinclair (2019) | 4 |
| Jackson & Bailey (2023) | 2 |
| Abreu & Lopes (2021) | 1 |
#|
IPBES.R::to_xlsx(snowball) |>
IPBES.R::table_dt(caption = "Snowball search as Excel file", fixedColumns = NULL)Warning in instance$preRenderHook(instance): It seems your data is too big for
client-side DataTables. You may consider server-side processing:
https://rstudio.github.io/DT/server.html
The column are: (the Concept columns are not that relevant at the moment)
#|
name <- "snowball"
if (
any(
!file.exists(
c(
file.path("figures", paste0(name, "_cited_by_count.png")),
file.path("figures", paste0(name, "_cited_by_count.pdf")),
file.path("figures", paste0(name, "_cited_by_count_by_year.png")),
file.path("figures", paste0(name, "_cited_by_count_by_year.pdf"))
)
)
)
) {
snowball_p <- snowball
for (i in seq_along(key_works_cit)) {
snowball_p$nodes$id[snowball_p$nodes$id %in% key_works_cit[[i]]["id"]] <- key_works_cit[[i]]["cit"]
snowball_p$edges$from[snowball_p$edges$from %in% key_works_cit[[i]]["id"]] <- key_works_cit[[i]]["cit"]
snowball_p$edges$to[snowball_p$edges$to %in% key_works_cit[[i]]["id"]] <- key_works_cit[[i]]["cit"]
}
IPBES.R::plot_snowball(snowball_p, name = "snowball", path = "figures")
rm(snowball_p)
}To download the highres graph, please click here.
name <- "snowball_supplemented"
if (
any(
!file.exists(
c(
file.path("figures", paste0(name, "_cited_by_count.png")),
file.path("figures", paste0(name, "_cited_by_count.pdf")),
file.path("figures", paste0(name, "_cited_by_count_by_year.png")),
file.path("figures", paste0(name, "_cited_by_count_by_year.pdf"))
)
)
)
) {
snowball_supplemented$nodes$cited_by_count_by_year <- snowball_supplemented$nodes$cited_by_count / (2024 - snowball_supplemented$nodes$publication_year)
snowball_p <- snowball_supplemented
for (i in seq_along(key_works_cit)) {
snowball_p$nodes$id[snowball_p$nodes$id %in% key_works_cit[[i]]["id"]] <- key_works_cit[[i]]["cit"]
snowball_p$edges$from[snowball_p$edges$from %in% key_works_cit[[i]]["id"]] <- key_works_cit[[i]]["cit"]
snowball_p$edges$to[snowball_p$edges$to %in% key_works_cit[[i]]["id"]] <- key_works_cit[[i]]["cit"]
}
IPBES.R::plot_snowball(snowball_p, name = name, path = "figures")
rm(snowball_p)
}