-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.qmd
51 lines (44 loc) · 1.27 KB
/
index.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
---
title: "Epiverse-TRACE CRAN checks"
format:
dashboard
---
```{r}
get_pkg_checks <- function(pkg) {
glue::glue("https://cran.r-project.org/web/checks/check_results_{pkg}.html") |>
xml2::read_html() |>
xml2::xml_find_first("//table") |>
rvest::html_table() |>
with(data = _, table(Status))
}
```
## CRAN checks
```{r, cache=TRUE}
et_cran_pkgs <- "https://epiverse-trace.r-universe.dev/api/packages/" |>
jsonlite::fromJSON() |>
dplyr::filter(
`_registered`,
`_cranurl`
) |>
dplyr::pull(Package)
```
```{r, cache=TRUE}
et_pkgs_cchecks <- et_cran_pkgs |>
purrr::map(get_pkg_checks) |>
dplyr::bind_rows() |>
dplyr::mutate(dplyr::across(everything(), as.numeric)) |>
dplyr::bind_rows(data.frame(OK = numeric(), NOTE = numeric(), WARN = numeric(), ERROR = numeric())) |>
dplyr::mutate(package = et_cran_pkgs, .before = 1) |>
dplyr::arrange(package) |>
dplyr::relocate(package, OK, NOTE, WARN, ERROR)
```
```{r, results='asis'}
et_pkgs_cchecks |>
dplyr::mutate(
package = glue::glue("[{package}](https://cran.r-project.org/web/checks/check_results_{package}.html)")
) |>
# pin id to avoid getting a random one each time and generating unnecessary diffs
gt::gt(id = "cchecks_table") |>
gt::fmt_markdown(package) |>
print()
```