Skip to content

Commit

Permalink
m
Browse files Browse the repository at this point in the history
  • Loading branch information
rhijmans committed Apr 29, 2024
1 parent 2368863 commit 3dd4d18
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
15 changes: 10 additions & 5 deletions source/_R/done.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,25 @@ fdone <- list.files(file.path(carob_path, "data", "compiled"), pattern="_metadat
x <- do.call(carobiner::bindr, lapply(fdone, read.csv))
url <- gsub("doi:", "https://doi.org/", x$uri)
url <- gsub("hdl:", "https://hdl.handle.net/", url)
suri <- sapply(x$uri, carobiner::simple_uri)
github <- paste0("https://github.com/reagro/carob/blob/master/scripts/", x$group, "/", suri, ".R")
script <- paste0('<a href="', github, '">R script</a>')
rep <- paste0("http://carob-data.org/reports/", x$group, "/", x$dataset_id, ".html")
frep <- basename(list.files(file.path(carob_path, "data", "clean"), pattern="html$", recursive = TRUE))
i <- x$dataset_id %in% gsub(".html", "", frep)
x$links <- paste0(x$group,
ifelse(i, paste0('</br><a href="', rep, '">report</a>'), ""), "")
# '</br><a href="', url, '">source</a>')
#x$links <- paste0(x$group,
# ifelse(i, paste0('</br><a href="', rep, '">report</a>'), ""), "")
## '</br><a href="', url, '">source</a>')
#i <- unlist(gregexpr("doi:|hdl:", x$data_citation))
cit <- do.call(rbind, strsplit(x$data_citation, "doi:|hdl:"))
cit <- data.frame(cit, url, x$uri)
x$citation <- apply(cit, 1, \(i) paste0(i[1], '<a href="', i[3], '">', i[4], '</a>'))
x$dataset <- paste0(x$citation, " [", x$group, "] ")
x$dataset <- ifelse(i, paste0(x$dataset, '<a href="', rep, '">Report</a>'), x$dataset)
x$dataset <- paste0(x$citation, " [", x$group, "] ", script)
x$dataset <- ifelse(i, paste0(x$dataset, ', <a href="', rep, '">Report</a>'), x$dataset)
```

Expand Down
1 change: 0 additions & 1 deletion source/contributors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ Here is a table with the names of *Carob* contributors and the number of dataset

.. raw:: html
:file: _R/contributors.html

0 comments on commit 3dd4d18

Please sign in to comment.