From f104f656753f0f13af412136239ae84feb7ad98c Mon Sep 17 00:00:00 2001 From: Donatus Herre Date: Fri, 20 Dec 2024 09:43:03 +0100 Subject: [PATCH] Add plots to document --- docs/index.Rmd | 51 ++++++++-- renv.lock | 254 ++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 294 insertions(+), 11 deletions(-) diff --git a/docs/index.Rmd b/docs/index.Rmd index ff53982..64999c8 100644 --- a/docs/index.Rmd +++ b/docs/index.Rmd @@ -14,15 +14,15 @@ knitr::opts_chunk$set(echo = FALSE, error = FALSE, message = FALSE, warning = FA knitr::opts_knit$set(root.dir = "..") ``` -```{r source-remote} +```{r source-remote, eval=F} doaj_journals <- readr::read_csv("https://doaj.org/csv", show_col_types = FALSE) ``` ```{r source-local} -doaj_journals_withdrawn <- readr::read_csv("data/doaj_changelog_withdrawn_list_enriched_utf8.csv") +doaj_journals_withdrawn <- readr::read_csv("data/doaj_changelog_withdrawn_list_enriched_utf8.csv", show_col_types = FALSE) ``` -```{r doaj-publisher-mapping} +```{r doaj-publisher-mapping, eval=F} # Mapping by @MiWohlgemuth doaj_journals[grepl("Elsevier|KeAi Communications", doaj_journals$Publisher, ignore.case = TRUE), "Publisher"] <- "Elsevier" doaj_journals[grepl("Wiley|American Geophysical Union", doaj_journals$Publisher, ignore.case = TRUE), "Publisher"] <- "Wiley" @@ -35,9 +35,44 @@ doaj_journals[grepl("MDPI", doaj_journals$Publisher, ignore.case = FALSE), "Publ doaj_journals[grepl("Frontiers Media", doaj_journals$Publisher, ignore.case = FALSE), "Publisher"] <- "Frontiers" ``` +# Plots + +```{r doaj-withdrawn-plots-df} +doaj_journals_withdrawn_plots <- doaj_journals_withdrawn[, c("title", "reason", "date_removed")] +doaj_journals_withdrawn_plots$date_removed_year <- format(doaj_journals_withdrawn_plots$date_removed, "%Y") +``` + +```{r doaj-withdrawn-plots-count-per-year} +ggplot2::ggplot(doaj_journals_withdrawn_plots, ggplot2::aes(x = date_removed_year)) + ggplot2::geom_bar() + + ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 0, vjust = 0.5, hjust = 1)) + + ggplot2::xlab("Year Withdrawn") + ggplot2::ylab("Number of journals") + ggplot2::labs(title = "Journals withdrawn from DOAJ per Year") +``` + +```{r doaj-withdrawn-plots-count-per-year-and-reason} +ggplot2::ggplot(doaj_journals_withdrawn_plots, ggplot2::aes(x = date_removed_year)) + ggplot2::geom_bar() + ggplot2::facet_grid(reason ~ .) + + ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 0, vjust = 0.5, hjust = 1)) + + ggplot2::xlab("Year Withdrawn") + ggplot2::ylab("Number of journals") + ggplot2::labs(title = "Journals withdrawn from DOAJ per Reason and Year") +``` + +```{r doaj-withdrawn-plots-not-best-df} +doaj_journals_withdrawn_select <- grepl("Journal not adhering to Best practice", doaj_journals_withdrawn$reason) & doaj_journals_withdrawn$publisher %in% c("SpringerNature", "Wiley", "Elsevier", "SAGE", "MDPI", "Oxford University Press", "De Gruyter Brill", "Taylor & Francis", "Wolters Kluwer", "Frontiers") +doaj_journals_withdrawn_plots2 <- doaj_journals_withdrawn[doaj_journals_withdrawn_select, c("title", "issn_l", "date_removed", "reason", "publisher")] +doaj_journals_withdrawn_plots2$date_removed_year <- format(doaj_journals_withdrawn_plots2$date_removed, "%Y") +doaj_journals_withdrawn_plots2 <- dplyr::count(doaj_journals_withdrawn_plots2, publisher, date_removed_year) +``` + +```{r doaj-withdrawn-plots-not-best-count-per-publisher-and-year} +ggplot2::ggplot(doaj_journals_withdrawn_plots2, ggplot2::aes(x = date_removed_year, y = n)) + ggplot2::geom_col() + ggplot2::facet_grid(publisher ~ .) + + ggplot2::geom_text(ggplot2::aes(x = date_removed_year, y = n, label = n), size = 2, vjust = -0.3, colour = "gray40") + + ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 0, vjust = 0.5, hjust = 1)) + + ggplot2::xlab("Year Withdrawn") + ggplot2::ylab("Number of journals") + ggplot2::labs(title = "Journals withdrawn from DOAJ per Publisher and Year") +``` + + -```{r doaj-publishers-withdrawn} +```{r doaj-publishers-withdrawn, eval=F} doaj_publishers_withdrawn <- setNames( as.data.frame( table(doaj_journals_withdrawn$publisher), stringsAsFactors = FALSE @@ -46,13 +81,15 @@ doaj_publishers_withdrawn <- setNames( ) ``` -```{r doaj-publishers-withdrawn-display, rownames.print=F} +```{r doaj-publishers-withdrawn-display, rownames.print=F, eval=F} doaj_publishers_withdrawn[1:100, ] ``` + -```{r doaj-publishers-indexed} +```{r doaj-publishers-indexed, eval=F} doaj_publishers <- setNames( as.data.frame( table(doaj_journals$Publisher), stringsAsFactors = FALSE @@ -61,7 +98,7 @@ doaj_publishers <- setNames( ) ``` -```{r doaj-publishers-indexed-display, rownames.print=F} +```{r doaj-publishers-indexed-display, rownames.print=F, eval=F} doaj_publishers[1:100, ] ``` diff --git a/renv.lock b/renv.lock index ee98b09..6184ddf 100644 --- a/renv.lock +++ b/renv.lock @@ -9,6 +9,38 @@ ] }, "Packages": { + "MASS": { + "Package": "MASS", + "Version": "7.3-61", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "grDevices", + "graphics", + "methods", + "stats", + "utils" + ], + "Hash": "0cafd6f0500e5deba33be22c46bf6055" + }, + "Matrix": { + "Package": "Matrix", + "Version": "1.7-1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "grDevices", + "graphics", + "grid", + "lattice", + "methods", + "stats", + "utils" + ], + "Hash": "5122bb14d8736372411f955e1b16bc8a" + }, "R6": { "Package": "R6", "Version": "2.5.1", @@ -19,6 +51,16 @@ ], "Hash": "470851b6d5d0ac559e9d01bb352b4021" }, + "RColorBrewer": { + "Package": "RColorBrewer", + "Version": "1.1-3", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R" + ], + "Hash": "45f0398006e83a5b10b72a90663d8d8c" + }, "base64enc": { "Package": "base64enc", "Version": "0.1-3", @@ -107,6 +149,20 @@ ], "Hash": "3f038e5ac7f41d4ac41ce658c85e3042" }, + "colorspace": { + "Package": "colorspace", + "Version": "2.1-1", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R", + "grDevices", + "graphics", + "methods", + "stats" + ], + "Hash": "d954cb1c57e8d8b756165d7ba18aa55a" + }, "cpp11": { "Package": "cpp11", "Version": "0.5.1", @@ -140,6 +196,29 @@ ], "Hash": "33698c4b3127fc9f506654607fb73676" }, + "dplyr": { + "Package": "dplyr", + "Version": "1.1.4", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "R6", + "cli", + "generics", + "glue", + "lifecycle", + "magrittr", + "methods", + "pillar", + "rlang", + "tibble", + "tidyselect", + "utils", + "vctrs" + ], + "Hash": "fedd9d00c2944ff00a0e2696ccf048ec" + }, "evaluate": { "Package": "evaluate", "Version": "1.0.1", @@ -162,6 +241,13 @@ ], "Hash": "962174cf2aeb5b9eea581522286a911f" }, + "farver": { + "Package": "farver", + "Version": "2.1.2", + "Source": "Repository", + "Repository": "RSPM", + "Hash": "680887028577f3fa2a81e410ed0d6e42" + }, "fastmap": { "Package": "fastmap", "Version": "1.2.0", @@ -192,6 +278,42 @@ ], "Hash": "7f48af39fa27711ea5fbd183b399920d" }, + "generics": { + "Package": "generics", + "Version": "0.1.3", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "methods" + ], + "Hash": "15e9634c0fcd294799e9b2e929ed1b86" + }, + "ggplot2": { + "Package": "ggplot2", + "Version": "3.5.1", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "MASS", + "R", + "cli", + "glue", + "grDevices", + "grid", + "gtable", + "isoband", + "lifecycle", + "mgcv", + "rlang", + "scales", + "stats", + "tibble", + "vctrs", + "withr" + ], + "Hash": "44c6a2f8202d5b7e878ea274b1092426" + }, "glue": { "Package": "glue", "Version": "1.8.0", @@ -203,6 +325,22 @@ ], "Hash": "5899f1eaa825580172bb56c08266f37c" }, + "gtable": { + "Package": "gtable", + "Version": "0.3.6", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "cli", + "glue", + "grid", + "lifecycle", + "rlang", + "stats" + ], + "Hash": "de949855009e2d4d0e52a844e30617ae" + }, "highr": { "Package": "highr", "Version": "0.11", @@ -244,6 +382,17 @@ ], "Hash": "81d371a9cc60640e74e4ab6ac46dcedc" }, + "isoband": { + "Package": "isoband", + "Version": "0.2.7", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "grid", + "utils" + ], + "Hash": "0080607b4a1a7b28979aecef976d8bc2" + }, "jquerylib": { "Package": "jquerylib", "Version": "0.1.4", @@ -280,6 +429,32 @@ ], "Hash": "9fcb189926d93c636dea94fbe4f44480" }, + "labeling": { + "Package": "labeling", + "Version": "0.4.3", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "graphics", + "stats" + ], + "Hash": "b64ec208ac5bc1852b285f665d6368b3" + }, + "lattice": { + "Package": "lattice", + "Version": "0.22-6", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "grDevices", + "graphics", + "grid", + "stats", + "utils" + ], + "Hash": "cc5ac1ba4c238c7ca9fa6a87ca11a7e2" + }, "lifecycle": { "Package": "lifecycle", "Version": "1.0.4", @@ -314,6 +489,23 @@ ], "Hash": "e2817ccf4a065c5d9d7f2cfbe7c1d78c" }, + "mgcv": { + "Package": "mgcv", + "Version": "1.9-1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "Matrix", + "R", + "graphics", + "methods", + "nlme", + "splines", + "stats", + "utils" + ], + "Hash": "110ee9d83b496279960e162ac97764ce" + }, "mime": { "Package": "mime", "Version": "0.12", @@ -324,14 +516,38 @@ ], "Hash": "18e9c28c1d3ca1560ce30658b22ce104" }, + "munsell": { + "Package": "munsell", + "Version": "0.5.1", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "colorspace", + "methods" + ], + "Hash": "4fd8900853b746af55b81fda99da7695" + }, + "nlme": { + "Package": "nlme", + "Version": "3.1-166", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "graphics", + "lattice", + "stats", + "utils" + ], + "Hash": "ccbb8846be320b627e6aa2b4616a2ded" + }, "pillar": { "Package": "pillar", - "Version": "1.9.0", + "Version": "1.10.0", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "cli", - "fansi", "glue", "lifecycle", "rlang", @@ -339,7 +555,7 @@ "utils", "vctrs" ], - "Hash": "15da5a8412f317beeee6175fbc76f4bb" + "Hash": "101ca350beea21261a15ba169d7a8513" }, "pkgconfig": { "Package": "pkgconfig", @@ -466,6 +682,26 @@ ], "Hash": "d53dbfddf695303ea4ad66f86e99b95d" }, + "scales": { + "Package": "scales", + "Version": "1.3.0", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R", + "R6", + "RColorBrewer", + "cli", + "farver", + "glue", + "labeling", + "lifecycle", + "munsell", + "rlang", + "viridisLite" + ], + "Hash": "c19df082ba346b0ffa6f833e92de34d1" + }, "tibble": { "Package": "tibble", "Version": "3.2.1", @@ -546,6 +782,16 @@ ], "Hash": "c03fa420630029418f7e6da3667aac4a" }, + "viridisLite": { + "Package": "viridisLite", + "Version": "0.4.2", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R" + ], + "Hash": "c826c7c4241b6fc89ff55aaea3fa7491" + }, "vroom": { "Package": "vroom", "Version": "1.6.5",