CRAN mirrors store older versions of packages in /src/contrib/Archive
,
and they also store some metadata about them in
/src/contrib/Meta/archive.rds
. pkgcache can download and cache this
metadata.
cran_archive_list(
cran_mirror = default_cran_mirror(),
update_after = as.difftime(7, units = "days"),
packages = NULL
)
cran_archive_update(cran_mirror = default_cran_mirror())
cran_archive_cleanup(cran_mirror = default_cran_mirror(), force = FALSE)
cran_archive_summary(cran_mirror = default_cran_mirror())
CRAN mirror to use, see default_cran_mirror()
.
difftime
object. Automatically update the cache if
it gets older than this. Set it to Inf
to avoid updates. Defaults
to seven days.
Character vector. Only report these packages.
Force cleanup in non-interactive mode.
cran_archive_list()
returns a data frame with columns:
package
: package name,
version
: package version. This is a character vector, and not
a package_version()
object. Some older package versions are not
supported by package_version()
.
raw
: the raw row names from the CRAN metadata.
mtime
: mtime
column from the CRAN metadata. This is usually
pretty close to the release date and time of the package.
url
: package download URL.
mirror
: CRAN mirror that was used to get this data.
The output is ordered according to package names (case insensitive) and
release dates.
cran_archive_update()
returns all archive data in a data frame,
in the same format as cran_archive_list()
, invisibly.
cran_archive_cleanup()
returns nothing.
cran_archive_summary()
returns a named list with elements:
cachepath
: Path to the directory that contains all archive cache.
current_rds
: Path to the RDS file that contains the data for
the specified cran_mirror
.
lockfile
: Path to the lock file for current_rds
.
timestamp
: Path to the time stamp for current_rds
. NA
if the
cache is empty.
size
: Size of current_rds
. Zero if the cache is empty.
cran_archive_list()
lists all versions of all (or some) packages.
It updates the cached data first, if it is older than the specified
limit.
cran_archive_update()
updates the archive cache.
cran_archive_cleanup()
cleans up the archive cache for
cran_mirror
.
cran_archive_summary()
prints a summary about the archive
cache.
The cran_archive_cache
class for more flexibility.
cran_archive_list(packages = "readr")
#> # A data frame: 21 × 6
#> package version raw mtime url mirror
#> * <chr> <chr> <chr> <dttm> <chr> <chr>
#> 1 readr 0.1.0 readr/readr_0.1.0.tar.gz 2015-04-08 23:03:56 https://… https…
#> 2 readr 0.1.1 readr/readr_0.1.1.tar.gz 2015-05-29 14:27:00 https://… https…
#> 3 readr 0.2.0 readr/readr_0.2.0.tar.gz 2015-10-20 09:44:22 https://… https…
#> 4 readr 0.2.1 readr/readr_0.2.1.tar.gz 2015-10-21 08:02:08 https://… https…
#> 5 readr 0.2.2 readr/readr_0.2.2.tar.gz 2015-10-22 06:24:39 https://… https…
#> 6 readr 1.0.0 readr/readr_1.0.0.tar.gz 2016-08-03 15:55:27 https://… https…
#> 7 readr 1.1.0 readr/readr_1.1.0.tar.gz 2017-03-22 19:24:25 https://… https…
#> 8 readr 1.1.1 readr/readr_1.1.1.tar.gz 2017-05-16 19:04:00 https://… https…
#> 9 readr 1.2.0 readr/readr_1.2.0.tar.gz 2018-11-22 08:40:08 https://… https…
#> 10 readr 1.2.1 readr/readr_1.2.1.tar.gz 2018-11-22 14:30:05 https://… https…
#> # ℹ 11 more rows