Learn R Programming

risk.assessr (version 3.0.1)

cran_packages: Retrieve the List of CRAN Packages (Internal)

Description

Downloads and caches the current list of packages available on CRAN.

Usage

cran_packages(cache = TRUE)

Value

A matrix of package metadata similar to the output of utils::available.packages(), with package names as row names.

Arguments

cache

Logical. If TRUE (default), the result is cached using memoise::memoise() with a timeout of 30 minutes to avoid repeated downloads. If FALSE, the metadata is fetched directly from CRAN each time the function is called.

Details

The function downloads the packages.rds file from the CRAN website, which contains metadata about all available packages. The result is cached using memoise::memoise() with a timeout of 30 minutes.

Examples

Run this code
# \donttest{
pkgs <- cran_packages()
head(rownames(pkgs))
# }

Run the code above in your browser using DataLab