Learn R Programming

checked (version 0.5.0)

available_packages: Available Packages

Description

Functionally Equivalent to utils::available.packages(), assuming utils's cache doesn't expire in the middle of a top-level call evaluation. Modifications were made so that the results for queries with unique arguments are only called once for each top-level expression.

Usage

available_packages(...)

Arguments

Details

Though utils::available.packages() will cache the PACKAGES index, it must still be parsed with each call. Since this can happen hundreds of times when building a R CMD check plan, this can cause a signficiant bottleneck to the responsiveness of this package.

system.time({ for (i in 1:10) available.packages() })
#>    user  system elapsed
#>   3.453   0.196   3.655

system.time({ for (i in 1:10) available_packages() }) #> user system elapsed #> 0.325 0.002 0.328