Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Commit

Permalink
Edit concepts extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
rkrug committed Dec 4, 2023
1 parent eb0e2a9 commit 3bbdd9d
Show file tree
Hide file tree
Showing 11 changed files with 129 additions and 94 deletions.
Binary file added DMR Summary/0_IPBES_TCA_3.2_Clusters.docx
Binary file not shown.
Binary file added DMR Summary/0_IPBES_TCA_3.2_Clusters.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion IPBES_TCA_Ch3_snowball_DMP.html

Large diffs are not rendered by default.

217 changes: 126 additions & 91 deletions IPBES_TCA_Ch3_snowball_DMP.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -283,22 +283,28 @@ OpenAlex assigns all works concepts. The concepts are in hirarchical order, rang
#| label: l0
#|
x <- lapply(
flat_snow[["concepts"]],
FUN = function(x) {
x[["display_name"]][x[["level"]] == 0]
}
) |>
unlist() |>
table() |>
as.data.frame() |>
rename(
l0_concept = Var1,
count = Freq
) |>
arrange(desc(count))
fn <- file.path("data", "concepts_l0.rds")
writexl::write_xlsx(x, file.path(".", "data", "concepts_l0.xlsx"))
if (!file.exists(fn)){
x <- lapply(
flat_snow[["concepts"]],
FUN = function(x) {
x[["display_name"]][x[["level"]] == 0]
}
) |>
unlist() |>
table() |>
as.data.frame() |>
rename(
l0_concept = Var1,
count = Freq
) |>
arrange(desc(count))
writexl::write_xlsx(x, file.path(".", "data", "concepts_l0.xlsx"))
} else {
x <- readRDS(fn)
}
knitr::kable(x)
```
Expand All @@ -310,23 +316,28 @@ To download the Excel file, please [click here](data/concepts_l0.xlsx).
#| label: l1
#|
x <- lapply(
flat_snow[["concepts"]],
function(x) {
x[["display_name"]][x[["level"]] == 1]
}
) |>
unlist() |>
table() |>
as.data.frame() |>
rename(
l1_concept = Var1,
count = Freq
) |>
arrange(desc(count))
writexl::write_xlsx(x, file.path(".", "data", "concepts_l1.xlsx"))
fn <- file.path("data", "concepts_l1.rds")
if (!file.exists(fn)){
x <- lapply(
flat_snow[["concepts"]],
function(x) {
x[["display_name"]][x[["level"]] == 1]
}
) |>
unlist() |>
table() |>
as.data.frame() |>
rename(
l1_concept = Var1,
count = Freq
) |>
arrange(desc(count))
writexl::write_xlsx(x, file.path(".", "data", "concepts_l1.xlsx"))
} else {
x <- readRDS(fn)
}
knitr::kable(x)
```

Expand All @@ -338,22 +349,28 @@ To download the Excel file, please [click here](data/concepts_l1.xlsx).
#| label: l2
#|
x <- lapply(
flat_snow[["concepts"]],
function(x) {
x[["display_name"]][x[["level"]] == 2]
}
) |>
unlist() |>
table() |>
as.data.frame() |>
rename(
l2_concept = Var1,
count = Freq
fn <- file.path("data", "concepts_l2.rds")
if (!file.exists(fn)){
x <- lapply(
flat_snow[["concepts"]],
function(x) {
x[["display_name"]][x[["level"]] == 2]
}
) |>
arrange(desc(count))
writexl::write_xlsx(x, file.path(".", "data", "concepts_l2.xlsx"))
unlist() |>
table() |>
as.data.frame() |>
rename(
l2_concept = Var1,
count = Freq
) |>
arrange(desc(count))
writexl::write_xlsx(x, file.path(".", "data", "concepts_l2.xlsx"))
} else {
x <- readRDS(fn)
}
knitr::kable(x)
```
Expand All @@ -366,22 +383,28 @@ To download the Excel file, please [click here](data/concepts_l2.xlsx).
#| label: l3
#|
x <- lapply(
flat_snow[["concepts"]],
function(x) {
x[["display_name"]][x[["level"]] == 3]
}
) |>
unlist() |>
table() |>
as.data.frame() |>
rename(
l3_concept = Var1,
count = Freq
fn <- file.path("data", "concepts_l3.rds")
if (!file.exists(fn)){
x <- lapply(
flat_snow[["concepts"]],
function(x) {
x[["display_name"]][x[["level"]] == 3]
}
) |>
arrange(desc(count))
writexl::write_xlsx(x, file.path(".", "data", "concepts_l3.xlsx"))
unlist() |>
table() |>
as.data.frame() |>
rename(
l3_concept = Var1,
count = Freq
) |>
arrange(desc(count))
writexl::write_xlsx(x, file.path(".", "data", "concepts_l3.xlsx"))
} else {
x <- readRDS(fn)
}
knitr::kable(x)
```
Expand All @@ -394,22 +417,28 @@ To download the Excel file, please [click here](data/concepts_l3.xlsx).
#| label: l4
#|
x <- lapply(
flat_snow[["concepts"]],
function(x) {
x[["display_name"]][x[["level"]] == 4]
}
) |>
unlist() |>
table() |>
as.data.frame() |>
rename(
l4_concept = Var1,
count = Freq
fn <- file.path("data", "concepts_l4.rds")
if (!file.exists(fn)){
x <- lapply(
flat_snow[["concepts"]],
function(x) {
x[["display_name"]][x[["level"]] == 4]
}
) |>
arrange(desc(count))
writexl::write_xlsx(x, file.path(".", "data", "concepts_l4.xlsx"))
unlist() |>
table() |>
as.data.frame() |>
rename(
l4_concept = Var1,
count = Freq
) |>
arrange(desc(count))
writexl::write_xlsx(x, file.path(".", "data", "concepts_l4.xlsx"))
} else {
x <- readRDS(fn)
}
knitr::kable(x)
```
Expand All @@ -422,22 +451,28 @@ To download the Excel file, please [click here](data/concepts_l4.xlsx).
#| label: l5
#|
x <- lapply(
flat_snow[["concepts"]],
function(x) {
x[["display_name"]][x[["level"]] == 5]
}
) |>
unlist() |>
table() |>
as.data.frame() |>
rename(
l5_concept = Var1,
count = Freq
fn <- file.path("data", "concepts_l5.rds")
if (!file.exists(fn)){
x <- lapply(
flat_snow[["concepts"]],
function(x) {
x[["display_name"]][x[["level"]] == 5]
}
) |>
arrange(desc(count))
writexl::write_xlsx(x, file.path(".", "data", "concepts_l5.xlsx"))
unlist() |>
table() |>
as.data.frame() |>
rename(
l5_concept = Var1,
count = Freq
) |>
arrange(desc(count))
writexl::write_xlsx(x, file.path(".", "data", "concepts_l5.xlsx"))
} else {
x <- readRDS(fn)
}
knitr::kable(x)
```
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ The info in `% %` need to be changed to the appropriate values. In addition, the
## Reports

- Reports
- [Snowball results](IPBES_BBA_Ch3_snowball_DMP.html)
- [Snowball results](IPBES_TCA_Ch3_snowball_DMP.html)
- Data Management Reports
- [SOD DOI](LINK TO DOI)
- [SOD DOI](https://doi.org/10.5281/zenodo.10218647)
- [TOD DOI - TO BE ADDED](LINK TO DOI)
- [Final DOI - TO BE ADDED](LINK TO DOI)
- Redundant Reports
Expand Down
Binary file modified data/concepts_l0.xlsx
Binary file not shown.
Binary file modified data/concepts_l1.xlsx
Binary file not shown.
Binary file modified data/concepts_l2.xlsx
Binary file not shown.
Binary file modified data/concepts_l3.xlsx
Binary file not shown.
Binary file modified data/concepts_l4.xlsx
Binary file not shown.
Binary file modified data/concepts_l5.xlsx
Binary file not shown.

0 comments on commit 3bbdd9d

Please sign in to comment.