R Under development (unstable) (2026-04-26 r89963 ucrt) -- "Unsuffered Consequences" Copyright (C) 2026 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library("repo.data") Attaching package: 'repo.data' The following object is masked from 'package:stats': alias > alias_columns <- c("Package", "Source", "Target") > pkges <- c("BaseSet", "experDesign") > bpkges <- c("tools", "compiler") > > # Test that cache works > st <- system.time(ca <- cran_alias(pkges)) Downloading and caching CRAN aliases for this session. > repo.data:::no_internet(ca) > stopifnot(colnames(ca) == alias_columns) > stopifnot(is.data.frame(ca)) > st1 <- system.time(ca2 <- cran_alias(pkges)) > stopifnot("Cache didn't work" = st1[[3]] < st[[3]]) > stopifnot("Cache was not the same" = all.equal(ca, ca2)) > > clean_cache() > st2 <- system.time(ca3 <- cran_alias(pkges)) Downloading and caching CRAN aliases for this session. > repo.data:::no_internet(ca3) > stopifnot("Clean cache restores initial state" = st2[[3]] > st1[[3]]) > stopifnot("Still same result" = all.equal(ca, ca3)) > > ca <- cran_alias() Warning: Packages with targets not present in a OS: 'sfsmisc' > repo.data:::no_internet(ca) > stopifnot(colnames(ca) == alias_columns) > ca2 <- cran_alias() > stopifnot("Cache returns the same for all packages" = all.equal(ca, ca2)) > > st <- system.time(ba <- base_alias(bpkges)) Downloading and caching base R's aliases for this session. > repo.data:::no_internet(ba) > stopifnot(colnames(ba) == alias_columns) > stopifnot(is.data.frame(ba)) > st1 <- system.time(ba2 <- base_alias(bpkges)) > stopifnot("Cache didn't work" = st1[[3]] < st[[3]]) > stopifnot("Cache was not the same" = all.equal(ba, ba2)) > > clean_cache() > st2 <- system.time(ba3 <- base_alias(bpkges)) Downloading and caching base R's aliases for this session. > repo.data:::no_internet(ba3) > stopifnot("Clean cache restores initial state" = st2[[3]] > st1[[3]]) > stopifnot("Still same result" = all.equal(ba, ba3)) > > ba <- base_alias() > repo.data:::no_internet(ba) > stopifnot(colnames(ba) == alias_columns) > ba2 <- base_alias() > stopifnot("Cache returns the same for all packages" = all.equal(ba, ba2)) > > > clean_cache() > > oldrepos <- getOption("repos") > on.exit(options(oldrepos), add = TRUE) > setRepositories(ind = 2, addURLs = c(CRAN = "https://cran.r-project.org")) > pkges <- c(pkges, "BioCor") > > st <- system.time(ba <- alias(pkges)) Warning: Packages found in multiple repositories'ClusterGVis' > repo.data:::no_internet(ba) > stopifnot(colnames(ba) == alias_columns) > st1 <- system.time(ba2 <- alias(pkges)) Warning: Packages found in multiple repositories'ClusterGVis' > stopifnot("Cache alias didn't work" = any(st1 < st)) > stopifnot("Alias with cache was not the same" = all.equal(ba, ba2)) > missing_pkg <- pkges[!pkges %in% ba2$Package] > > if (length(missing_pkg)) { + stop(sprintf("All packages are present on alias output: %s", toString(missing_pkg))) + } > > clean_cache() > setRepositories(ind = 2, addURLs = c(CRAN = "https://cran.r-project.org")) > st2 <- system.time(ba3 <- alias(pkges)) Warning: Packages found in multiple repositories'ClusterGVis' > repo.data:::no_internet(ba3) > stopifnot("Clean cache restores initial state" = any(st2 > st1)) > stopifnot("Still same result" = all.equal(ba, ba3)) > > ba <- alias() Warning: Packages found in multiple repositories'ClusterGVis' Warning: Packages with targets not present in a OS: 'base', 'grDevices', 'parallel', 'sfsmisc' > setRepositories(ind = 2, addURLs = c(CRAN = "https://cran.r-project.org")) > repo.data:::no_internet(ba) > stopifnot(colnames(ba) == alias_columns) > ba2 <- alias() Warning: Packages found in multiple repositories'ClusterGVis' > stopifnot("Cache returns the same for all packages" = all.equal(ba, ba2)) > > > rtweet <- alias("rtweet") Warning: Packages found in multiple repositories'ClusterGVis' > stopifnot(NROW(rtweet) == 0L) > > proc.time() user system elapsed 30.65 1.12 32.25