-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackages.qmd
186 lines (148 loc) · 6.61 KB
/
packages.qmd
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
---
title: "Packages"
---
```{r}
#| include: false
library(httr2)
library(purrr)
library(dplyr)
library(stringr)
library(glue)
print_pkgs <- function(p) {
walk(p, \(x) {
cat("::: {layout=\"[1,10]\" layout-valign=\"center\"}", "\n")
cat(x$logo, "\n\n")
cat(x$pkg, "[{{< fa brands github >}}](", x$github, ")", "\n")
cat(x$badge, "<br>")
cat(x$description, "<br>\n")
cat(":::")
cat("\n\n")
})
}
find_logo <- function(url) {
o <- str_extract(url, "(?<=com/)[^/]+")
r <- str_extract(url, "[^/]+/?$")
b <- gh::gh("/repos/{owner}/{repo}/branches", owner = o, repo = r) |>
map_chr("name") |>
str_subset("main$|master$")
f <- gh::gh("/repos/{owner}/{repo}/git/trees/{branch}", recursive = "true",
owner = o, repo = r, branch = b) |>
pluck("tree") |>
map_chr("path")
p <- str_subset(f, "((logo)|(hex)).*\\.[a-zA-Z]{3,4}$")
p_ext <- str_extract(p, "[a-zA-Z]{3,4}$") |> tolower()
p <- p[order(match(p_ext, c("png", "jpg", "svg")))][1]
if(!is.na(p)) p <- glue("{url}/blob/{b}/{p}?raw=true")
p
}
```
```{r}
#| include: false
#| cache: true
pkgs_list <- c("https://reconhub.r-universe.dev/api/packages",
"https://reconverse.r-universe.dev/api/packages") |>
setNames(nm = _) |>
map(\(x) {
request(x) |>
req_user_agent("RECON Website") |>
req_perform() |>
resp_body_json()
})
pkgs <- do.call("c", pkgs_list) |>
map(\(x) x[c("Package", "Title", "Author", "Maintainer", "Description", "Version", "URL", "RemoteUrl")]) |>
map(as_tibble) |>
list_rbind(names_to = "universe") |>
rename_with(tolower) |>
rename(github = remoteurl) |>
mutate(logo_url = map_chr(github, find_logo))
```
```{r}
#| include: false
pkgs <- pkgs |>
mutate(across(c(url, description), \(x) str_replace_all(x, "\\n", " "))) |>
mutate(
url = map(url, \(x) str_split_1(x, ", ?") |> str_subset("github.com", negate = TRUE)),
url = map_chr(url, 1, .default = NA),
url = if_else(is.na(url), github, url),
maintainer = str_extract(maintainer, "\\w+"),
universe = str_extract(universe, "(?<=https://)[a-z]+(?=\\.)"),
logo_url = if_else(is.na(logo_url), "img/purple.png", logo_url),
logo = glue("[{{.pkg-logo}}]({url})"),
pkg = glue("[{package}]({url})"),
description = str_remove_all(description, " \\(<?https://.[^ ]+\\.org/?>?\\)"),
description = str_remove_all(description, "This package is part .+ analysis\\."),
status = "stable",
badge = glue("")) |>
arrange(universe, package)
```
These are R packages developed as part of RECON or related to RECON.
## Standard
Members of the [R Epidemics Consortium](https://www.repidemicsconsortium.org/)
have, for many years, been creating resources and software that could be used
to inform the response to disease outbreaks, health emergencies and
humanitarian crises. During this time, as well as providing training materials,
running workshops and having members deployed to the field to help with data
analytics, a variety of [R](https://www.r-project.org/) packages have been
created to enable analysts to quickly solve the problems they have.
```{r}
#| echo: false
#| results: asis
p <- filter(pkgs, universe == "reconhub") |>
nest_by(package, .keep = TRUE) |>
pull(data)
print_pkgs(p)
```
## Reconverse
Since the early days of RECON, the landscape of packages for the analysis of
epidemics has grown, evolved and diversified, benefiting from feedback and
contributions from our members as well as other groups. While such organic
growth was needed and resulted in overall improvements of available tools, it
has also led to a less consistent software landscape, with several packages
overlapping or duplicating efforts, limited interoperability, and varying coding
and development standards. Being aware that fragmented software landscapes can
be the bane of data scientists
(e.g. [Excoffier and Heckel 2006](https://www.nature.com/articles/nrg1904), we
realise there is also benefit to having a coherent and composable set of
packages for users. The *reconverse* aims to address this. Much like the
[tidyverse](https://www.tidyverse.org/) is "an opinionated collection of R
packages designed for data science", the reconverse aims to be an opinionated
ecosystem of packages for Outbreak Analytics.
The *reconverse* aims to provide a coherent and composable suite of analytics tools for informing the response to disease outbreaks, health emergencies and humanitarian crises.
We work hard to ensure packages within the reconverse fulfill three key goals:
- Efficiency: Packages can be used in real time to improve situation awareness and inform intervention strategies.
- Reliability: Packages are thoroughly and constantly tested using professional software development methods.
- Accessibility: Packages are free, open-source, and available on virtually any platform; and can be used with different levels of expertise.
```{r}
#| echo: false
#| results: asis
p <- filter(pkgs, universe == "reconverse") |>
nest_by(package, .keep = TRUE) |>
pull(data)
print_pkgs(p)
```
## Related
**TODO:** Need to identify these packages in an R-Universe.
## Lifecycle
When a user considers utilising a package in their work it is helpful to provide
them with information on the development plans around the package. This allows
them to make an informed decision as to whether they want to take that package
as a dependency. To help users understand the development status of a package
we use lifecycle badges to relay one of 4 stages of package maturity;
[*concept*](#concept), [*experimental*](#experimental), [*maturing*](#maturing) and
[*stable*](#stable):
{fig-alt="Diagram showing relationship between package maturity and time. Demonstrating how packages go through stages from concept to experimental to maturing to stable"}
#### Concept 
Initial ideas of what the package will be, maybe some gist of code and
discussions among developers, but not much more.
#### Experimental 
Draft of a functional package, but interfaces and functionalities may change
over time, testing and documentation may be lacking. Typically semantic
version < 0.1.0.
#### Maturing 
Package is functional, documented and tested. Can be used in production with the
understanding that the interface may still undergo minor changes. Typically
semantic version < 1.0.0.
#### Stable 
Package is functional, documented and tested. The interface is not meant to
change in the future. Can be used in production and relied upon by other
packages. Typically semantic version >= 1.0.0.