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 > pkges <- c("BaseSet", "experDesign") > > # Test that it works > st1 <- system.time(ctl <- cran_targets_links(pkges)) Downloading and caching CRAN's packages xrefs for this session. Downloading and caching base R's aliases for this session. Warning: Packages with targets not present in a OS: 'base', 'grDevices', 'parallel' Downloading and caching CRAN aliases for this session. Warning: Packages with targets not present in a OS: 'sfsmisc' Warning message: Some links are distinct depending on the OS. > repo.data:::no_internet(ctl) > stopifnot(colnames(ctl) == c("from_pkg", "from_Rd", "to_pkg", "to_target", "to_Rd", "n")) > stopifnot("CRAN has documentation pages" = as.logical(NROW(ctl))) > stopifnot("Returns more than from the packages requested" = all(ctl$from_pkg %in% pkges)) > > # Cache > st2 <- system.time(ctl2 <- cran_targets_links(pkges)) > repo.data:::no_internet(ctl2) > stopifnot(identical(ctl, ctl2)) > stopifnot("Second call is not faster than first one" = st2["elapsed"] < st1["elapsed"]) > > st3 <- system.time(ctl3 <- cran_targets_links()) Warning message: Some links are distinct depending on the OS. > repo.data:::no_internet(ctl3) > stopifnot("Requests for all packages failed" = nrow(ctl3) > nrow(ctl)) > stopifnot("Cache doesn't work for requested packages" = any(st3 < st1)) #: Faster process all than just some? > > # Page links > st1 <- system.time(cpl <- cran_pages_links(pkges)) > repo.data:::no_internet(cpl) > st2 <- system.time(cpl2 <- cran_pages_links(pkges)) > repo.data:::no_internet(cpl2) > stopifnot(identical(cpl, cpl2)) > st3 <- system.time(cpl <- cran_pages_links()) Warning message: Some links are distinct depending on the OS. > repo.data:::no_internet(cpl) > stopifnot("Didn't return all packages" = nrow(cpl) > nrow(cpl2)) > > # Packages links > st1 <- system.time(cpl <- cran_pkges_links(pkges)) > repo.data:::no_internet(cpl) > st2 <- system.time(cpl2 <- cran_pkges_links(pkges)) > repo.data:::no_internet(cpl2) > # stopifnot("Cache doesn't work for requested packages" = any(st2 < st1)) > stopifnot(identical(cpl, cpl2)) > st3 <- system.time(cpl <- cran_pkges_links()) Warning message: Some links are distinct depending on the OS. > repo.data:::no_internet(cpl) > stopifnot("Didn't return all packages" = nrow(cpl) > nrow(cpl2)) > > proc.time() user system elapsed 545.45 29.98 575.42