Skip to content

Commit

Permalink
m
Browse files Browse the repository at this point in the history
  • Loading branch information
rhijmans committed May 21, 2024
1 parent 25c472f commit 304bd3e
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 24 deletions.
68 changes: 48 additions & 20 deletions source/_R/contributors.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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, ]
```
<br>

<br>

```{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`


<br>
3 changes: 2 additions & 1 deletion source/contributors.rst
Original file line number Diff line number Diff line change
@@ -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

5 changes: 2 additions & 3 deletions source/standard.rst
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/reagro/terminag>`__ github site and via the R package `carobiner <https://github.com/reagro/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.


0 comments on commit 304bd3e

Please sign in to comment.