-
Notifications
You must be signed in to change notification settings - Fork 2
/
check-divergences.R
44 lines (38 loc) · 1.21 KB
/
check-divergences.R
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
library(rcheology)
library(readr)
library(dplyr)
lost <- changed <- list()
for (rv in rcheology::Rversions$Rversion) {
r_new <- try(read_csv(sprintf("docker-data/pkg_data-R-%s.csv", rv),
show_col_types = FALSE))
r_old <- rcheology |> filter(Rversion == rv)
if (nrow(r_old) == 0) {
lost[[rv]] <- 'NO OLD'
next
}
if (inherits(r_new, "try-error") || nrow(r_new) == 0) {
lost[[rv]] <- 'NO DATA'
next
}
lost[[rv]] <- anti_join(r_old, r_new, by = c("package", "name"))
both <- inner_join(r_old, r_new, by = c("package", "name"), suffix = c(".old", ".new"))
changed[[rv]] <- both |>
filter(
type.old != type.new | class.old != class.new
)
if (nrow(lost[[rv]]) == 0) lost[[rv]] <- "OK"
}
invisible(lapply(rcheology::Rversions$Rversion,
\(x) {
cat(x, "\t")
l <- lost[[x]]
if (is.character(l)) {cat(l, "\n"); return()}
cat(nrow(l), unique(l$package), "\n", sep = "\t")
}))
invisible(lapply(rcheology::Rversions$Rversion,
\(x) {
cat(x, "\t")
ch <- changed[[x]]
cat(nrow(ch), "\n")
}))
chall <- purrr::list_rbind(changed, names_to = "Rversion") |> as_tibble()