pkgcache-package {pkgcache}R Documentation

Cache for package data and metadata

Description

Metadata and package cache for CRAN-like repositories. This is a utility package to be used by package management tools that want to take advantage of caching.

Details

Metadata and package cache for CRAN-like repositories. This is a utility package to be used by package management tools that want to take advantage of caching.

Installation

You can install the released version of pkgcache from CRAN with:

install.packages("pkgcache")

Metadata cache

meta_cache_list() lists all packages in the metadata cache. It includes Bioconductor package, and all versions (i.e. both binary and source) of the packages for the current platform and R version.

library(pkgcache)
meta_cache_list()
#> # A tibble: 36,184 x 33
#>    package title version depends suggests built imports archs repodir platform
#>    <chr>   <chr> <chr>   <chr>   <chr>    <chr> <chr>   <chr> <chr>   <chr>   
#>  1 A3      "Acc~ 1.0.0   R (>= ~ randomF~ R 3.~  <NA>   <NA>  bin/ma~ macos   
#>  2 aaSEA   "Ami~ 1.1.0   R(>= 3~ knitr, ~ R 3.~ "DT(>=~ <NA>  bin/ma~ macos   
#>  3 ABACUS  "App~ 1.0.0   R (>= ~ rmarkdo~ R 3.~ "ggplo~ <NA>  bin/ma~ macos   
#>  4 abbyyR  "Acc~ 0.5.5   R (>= ~ testtha~ R 3.~ "httr,~ <NA>  bin/ma~ macos   
#>  5 abc.da~ "Dat~ 1.0     R (>= ~ <NA>     R 3.~  <NA>   <NA>  bin/ma~ macos   
#>  6 ABC.RAP "Arr~ 0.9.0   R (>= ~ knitr, ~ R 3.~ "graph~ <NA>  bin/ma~ macos   
#>  7 abc     "Too~ 2.1     R (>= ~ <NA>     R 3.~  <NA>   <NA>  bin/ma~ macos   
#>  8 abcADM  "Fit~ 1.0     <NA>    <NA>     R 3.~ "Rcpp ~ abcA~ bin/ma~ macos   
#>  9 ABCana~ "Com~ 1.2.1   R (>= ~ <NA>     R 3.~ "plotr~ <NA>  bin/ma~ macos   
#> 10 abcdeF~ "ABC~ 0.4     Rglpk,~ LIM,syb~ R 3.~  <NA>   <NA>  bin/ma~ macos   
#> # ... with 36,174 more rows, and 23 more variables: rversion <chr>,
#> #   needscompilation <chr>, priority <chr>, ref <chr>, type <chr>,
#> #   direct <lgl>, status <chr>, target <chr>, mirror <chr>, sources <list>,
#> #   filesize <int>, sha256 <chr>, sysreqs <chr>, published <dttm>, deps <list>,
#> #   license <chr>, md5sum <chr>, linkingto <chr>, enhances <chr>,
#> #   license_restricts_use <chr>, os_type <chr>, license_is_foss <chr>,
#> #   path <chr>

meta_cache_deps() and meta_cache_revdeps() can be used to look up dependencies and reverse dependencies.

The metadata is updated automatically if it is older than seven days, and it can also be updated manually with meta_cache_update().

See the cranlike_metadata_cache R6 class for a lower level API, and more control.

Package cache

Package management tools may use the pkg_cache_* functions and in particular the package_cache class, to make use of local caching of package files.

The pkg_cache_* API is high level, and uses a user level cache:

pkg_cache_summary()
#> $cachepath
#> [1] "/Users/gaborcsardi/Library/Caches/R-pkg/pkg"
#> 
#> $files
#> [1] 45
#> 
#> $size
#> [1] 62270503
pkg_cache_list()
#> # A tibble: 45 x 9
#>    fullpath     path      package url      etag  sha256   version platform built
#>    <chr>        <chr>     <chr>   <chr>    <chr> <chr>    <chr>   <chr>    <int>
#>  1 /Users/gabo~ src/cont~ usethis <NA>      <NA> 1eb8efc~ <NA>    <NA>         0
#>  2 /Users/gabo~ src/cont~ testth~ <NA>      <NA> b7e0682~ <NA>    <NA>         0
#>  3 /Users/gabo~ src/cont~ waldo   <NA>      <NA> 8a33455~ <NA>    <NA>         0
#>  4 /Users/gabo~ src/cont~ testth~ <NA>      <NA> 95f987c~ <NA>    <NA>         0
#>  5 /Users/gabo~ src/cont~ testth~ <NA>      <NA> 7c068df~ <NA>    <NA>         0
#>  6 /Users/gabo~ bin/maco~ polycl~ https:/~ "\"7~ f396afd~ 1.10-0  macos       NA
#>  7 /Users/gabo~ bin/maco~ vpc     https:/~ "\"d~ ab43b8f~ 1.1.0   macos       NA
#>  8 /Users/gabo~ bin/maco~ tweenr  https:/~ "\"f~ dc551dd~ 1.0.1   macos       NA
#>  9 /Users/gabo~ bin/maco~ farver  https:/~ "\"1~ c8b5d2f~ 2.0.3   macos       NA
#> 10 /Users/gabo~ bin/maco~ ggforce https:/~ "\"4~ d635860~ 0.3.1   macos       NA
#> # ... with 35 more rows
pkg_cache_find(package = "dplyr")
#> # A tibble: 0 x 9
#> # ... with 9 variables: fullpath <chr>, path <chr>, package <chr>, url <chr>,
#> #   etag <chr>, sha256 <chr>, version <chr>, platform <chr>, built <int>

pkg_cache_add_file() can be used to add a file, pkg_cache_delete_files() to remove files, pkg_cache_get_files() to copy files out of the cache.

The package_cache class provides a finer API.

Bioconductor support

Both the metadata cache and the package cache support Bioconductor by default, automatically. See the BioC_mirror option and the R_BIOC_MIRROR and R_BIOC_VERSION environment variables below to configure pkgcache’s Bioconductor support.

Package Options

Package environment variables

Code of Conduct

Please note that the ‘pkgcache’ project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

License

MIT © RStudio Inc

Author(s)

Maintainer: Gábor Csárdi csardi.gabor@gmail.com

See Also

Useful links:


[Package pkgcache version 1.1.1 Index]