-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.Rmd
109 lines (83 loc) · 3.73 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
<!-- force push by editing this number: 42 -->
<!-- README.md is generated from README.Rmd. Please edit that file -->
<!-- Build with devtools::build_readme() -->
```{r, echo = FALSE}
magicnum <- tryCatch({
version <- as.vector(read.dcf('DESCRIPTION')[, 'Version'])
logos <- length(list.files("man/figures", "logo-\\d+.png"))
(sum(as.numeric(strsplit(version, "\\.")[[1]]))-3) %% logos
}, error = function(e) {
0
})
```
# One Health VBD Hub (ohvbd) <a href="https://fwimp.github.io/ohvbd/"><img src="man/figures/logo-`r magicnum`.png" align="right" width="120" alt="ohvbd website" /></a>
<!-- # One Health VBD Hub - R Package -->
<!-- badges: start -->
```{r, echo = FALSE}
dep <- as.vector(read.dcf('DESCRIPTION')[, 'Depends'])
m <- regexpr('\\d\\.*\\d+\\.*\\d*\\.*\\d*', dep)
rvers <- regmatches(dep, m)
# rvers <- gsub('.*(\\\\d+.\\\\d+.\\\\d+).*', '\\\\1', rm)
# rm
```
```{r, echo = FALSE}
version <- as.vector(read.dcf('DESCRIPTION')[, 'Version'])
version <- gsub('-', '.', version)
```
[](https://cran.r-project.org/)
[](commits/master)
[](https://www.gnu.org/licenses/gpl-3.0.en.html)
[](https://github.com/fwimp/ohvbd/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
## Introduction
`ohvbd` is an R package for retrieving (and parsing) data from a network of disease vector data sources.
At present this package is very much in its early stages, as such the internal API may change without warning.
## Databases
`ohvbd` allows for searching and the retrieval of data from the following data sources:
- [VecTraits](https://vectorbyte.crc.nd.edu/vectraits-explorer)
- [VecDyn](https://vectorbyte.crc.nd.edu/vecdyn-datasets)
- [AreaData](https://pearselab.github.io/areadata/)
## Installation
You can install the development version of ohvbd from [GitHub](https://github.com/fwimp/ohvbd) with:
``` r
# install.packages("devtools")
devtools::install_github("fwimp/ohvbd", build_vignettes = TRUE)
```
## Latest patch notes
```{r echo=FALSE}
# Note this only handles up to h2 level right now. Will need some fiddling if more is needed further down the line!
# In that case might be worth detecting and generating arbitrary levels of nesting with some clever recursive programming.
news <- parsermd::as_tibble(parsermd::parse_rmd(system.file("NEWS.md", package = "ohvbd")))
md_chunks <- subset(news, type=="rmd_markdown")
latest_version <- md_chunks[[1,1]]
filtered_md_chunks <- subset(md_chunks, md_chunks$sec_h1 == latest_version)
notes <- c()
if (all(is.na(filtered_md_chunks$sec_h2))) {
notes <- parsermd::as_document(md_chunks[[1,"ast"]], collapse = "\n")
} else {
notes <- tryCatch({
for (i in 1:nrow(filtered_md_chunks)) {
# cat(paste0("## ", filtered_md_chunks[i, "sec_h2"], "\n\n", parsermd::as_document(md_chunks[[i,"ast"]], collapse = "\n")))
notes <- c(notes, paste0("#### ", filtered_md_chunks[i, "sec_h2"], "\n\n", parsermd::as_document(md_chunks[[i,"ast"]], collapse = "\n")))
}
paste(notes, collapse = "\n")
}, error = function(e) {
parsermd::as_document(md_chunks[[1,"ast"]], collapse = "\n")
})
}
```
<!-- These are auto-pulled from NEWS.md -->
### `r latest_version`
`r notes`
See [changelog](https://fwimp.github.io/ohvbd/news/index.html) for patch notes for previous versions.