From 304bd3e53083eeed30aa2531787d860fb3499cc0 Mon Sep 17 00:00:00 2001 From: rhijmans Date: Tue, 21 May 2024 08:07:26 -0700 Subject: [PATCH] m --- source/_R/contributors.rmd | 68 +++++++++++++++++++++++++++----------- source/contributors.rst | 3 +- source/standard.rst | 5 ++- 3 files changed, 52 insertions(+), 24 deletions(-) diff --git a/source/_R/contributors.rmd b/source/_R/contributors.rmd index 8d69fbf..25dc39e 100644 --- a/source/_R/contributors.rmd +++ b/source/_R/contributors.rmd @@ -25,30 +25,58 @@ groups <- gsub("^carob_", "", groups) d <- lapply(f, read.csv) -p <- lapply(1:length(d), \(i) { - n <- d[[i]]$carob_contributor - n <- unlist(strsplit(n, " and ")) - n <- unlist(strsplit(n, ", ")) - n <- unlist(strsplit(n, " & ")) - data.frame(id=i, p=n) - } - ) -p <- do.call(rbind, p) -#groups <- gsub("conservation_agriculture", "cons_ag", groups) -#groups <- gsub("_trials", "", groups) -#groups <- gsub("_samples", "", groups) -#p[,1] <- groups[p[,1]] -#tab <- table(p[,2], p[,1]) -tab <- as.data.frame(table(p$p)) -colnames(tab) <- c("name", "datasets") -``` +get_tab <- function(d, var) { + p <- lapply(1:length(d), \(i) { + n <- d[[i]][[var]] + n <- unlist(strsplit(n, ";")) + data.frame(id=i, p=trimws(n)) + } + ) + p <- do.call(rbind, p) + p$p <- gsub(",", ", ", p$p) + p$p <- gsub(", ", ", ", p$p) + p$p <- gsub("-, ", "", p$p) # "-, RHoMIS" + tab <- as.data.frame(table(p$p)) + colnames(tab) <- c("name", "datasets") + tab +} + +cartab <- get_tab(d, "carob_contributor") +autab <- get_tab(d, "authors") +intab <- get_tab(d, "data_institute") +i <- tolower(autab$name) %in% c("", "not applicable") +autab <- autab[!i, ] +``` +

-```{r grouptable, echo=FALSE} -kableExtra::kbl(tab) |> kable_classic(full_width = FALSE) |> - kable_styling(bootstrap_options = c("striped", "hover")) +### Script authors + +```{r catable, echo=FALSE} +out = paste0(paste0(cartab[,1], " (", cartab[,2], ")"), collapse="; ") +#kableExtra::kbl(cartab) |> kable_classic(full_width = FALSE) |> +# kable_styling(bootstrap_options = c("striped", "hover")) +``` +`r out` + +### Dataset institutes + +```{r instable, echo=FALSE} +out = paste0(paste0(intab[,1], " (", intab[,2], ")"), collapse="; ") +#kableExtra::kbl(intab) |> kable_classic(full_width = FALSE) |> +# kable_styling(bootstrap_options = c("striped", "hover")) +``` +`r out` + +### Dataset authors + +```{r autable, echo=FALSE} +out <- paste0(paste0(autab[,1], " (", autab[,2], ")"), collapse="; ") +#DT::datatable(autab, escape=FALSE, rownames=FALSE) ``` +`r out` +
diff --git a/source/contributors.rst b/source/contributors.rst index 90b0a35..56219f8 100644 --- a/source/contributors.rst +++ b/source/contributors.rst @@ -1,7 +1,8 @@ Contributors ============ -Here is a table with the names of *Carob* contributors and the number of datasets that they have contributed. +Here are lists the contributors of Carob scripts and of the datasets processed. Names are followed by the number of scripts/datasets. Note that dataset author names are not standardized. .. raw:: html :file: _R/contributors.html + diff --git a/source/standard.rst b/source/standard.rst index 4998f31..9d370ef 100644 --- a/source/standard.rst +++ b/source/standard.rst @@ -1,11 +1,10 @@ The standard ============ -*Carob* uses the *terminag* standard that defines a controlled vocabulary of variable names, their units, and acceptable (ranges of) values. +*Carob* uses the **terminag** standard that defines a controlled vocabulary of variable names, their units, and acceptable (ranges of) values. The *terminag* standard can be used "stand-alone" for your own data, and as part of the data compilation done through the Carob project. -The standard is defined in a number of tables that are available on the [termiag](https://github.com/reagro/termiag) github site and via the R package carobiner. The standard is not an ontology in the sense that, with very few exceptions, it does not semantically relate variables to each other. - +The standard is defined in a number of tables that are available on the `termiag `__ github site and via the R package `carobiner `__. The terminag standard is not an ontology in the sense that, with very few exceptions, it does not semantically relate variables to each other.