cache: The download cache

cacheR Documentation

The download cache

Description

A version of a dataset never changes once published, so a file downloaded once can be kept and read again without another download. Nothing is kept unless you ask: pass 'cache = TRUE' to [pd_read()], [pd_download()], [pd_connect()], [pd_tbl()] or [pd_sf()], or set 'options(publicdataau.cache = TRUE)' for every call.

Usage

pd_cache_dir()

pd_cache_list(slug = NULL, version = NULL)

pd_cache_clear(slug = NULL, version = NULL)

Arguments

slug

Only this dataset's files. Every dataset when 'NULL'.

version

Only this version's files. Every version when 'NULL'.

Details

'pd_cache_dir()' is where kept files go: 'tools::R_user_dir("publicdataau", "cache")' unless 'options(publicdataau.cache_dir = )' names another folder. 'pd_cache_list()' lists what is kept and 'pd_cache_clear()' deletes it.

Value

‘pd_cache_dir()' returns the folder’s path. 'pd_cache_list()' returns a tibble with one row per kept file: its dataset, version, file, size in bytes and when it was saved. 'pd_cache_clear()' returns the number of bytes freed, invisibly.

See Also

Other files: pd_download(), pd_read(), pd_url()

Examples

pd_cache_dir()
pd_cache_list()

publicdataau documentation built on Oct. 14, 2026, 5:07 p.m.