Last active
February 4, 2026 11:10
-
-
Save gaborcsardi/797472e42b43d2f938f852614f2a170f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| meta <- "https://mac.r-project.org/bin/macosx/big-sur-arm64/contrib/4.5/PACKAGES" | |
| list <- dirname(meta) | |
| mlist <- read.dcf(url(meta)) | |
| vmeta <- mlist |> | |
| as.data.frame() |> | |
| (\(x) x[, c("Package", "Version")])() | |
| html <- rvest::read_html(list) | |
| vfiles <- html |> | |
| rvest::html_elements("a") |> | |
| rvest::html_text() |> | |
| grep(pattern = "[.]tgz$", value = TRUE) |> | |
| sub(pattern = "[.]tgz$", replacement = "") |> | |
| strsplit("_") | |
| vlist <- data.frame( | |
| Package = sapply(vfiles, "[[", 1), | |
| Version = sapply(vfiles, "[[", 2) | |
| ) | |
| ## I usually don't see any duplicated packages | |
| stopifnot(isFALSE(any(duplicated(vmeta$Package)))) | |
| stopifnot(isFALSE(any(duplicated(vlist$Package)))) | |
| pmeta <- paste0(vmeta$Package, "-", vmeta$Version) | |
| plist <- paste0(vlist$Package, "-", vlist$Version) | |
| ## Packages only in the metadata | |
| length(setdiff(pmeta, plist)) | |
| ##> [1] 566 | |
| head(setdiff(pmeta, plist)) | |
| ##> [1] "AFR-0.3.7" "AICcPermanova-0.0.2" "ARCokrig-0.1.2" | |
| ##> [4] "ARpLMEC-2.4.1" "AdverseEvents-0.0.4" "AnaCoDa-0.1.4.4" | |
| ## Indeed AFR (archived package) is in the metadata, but no package file. | |
| ## But the main issue is with these newly released and built packages, | |
| ## only in the package list: | |
| setdiff(plist, pmeta) | |
| ##> [1] "AdverseEvents-0.0.5" "BTSR-1.0.2" "UComp-5.1.7" | |
| ##> [4] "allMT-0.1.1" "bamm-0.6.0" "climate-1.2.9" | |
| ##> [7] "epiworldR-0.11.2.0" "ir-0.4.2" "layer-0.0.4" | |
| ##> [10] "mlflow-3.9.0" | |
| ## whereas the metadata has AdverseEvents-0.0.4, BTSR-1.0.1, etc. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment