View and set the directory for the data catalog

ca_getcache(quiet = TRUE)

ca_setcache(
  cache_dir = NULL,
  make_dir = TRUE,
  save = TRUE,
  reset = FALSE,
  quiet = FALSE
)

Arguments

quiet

Suppress messages

cache_dir

The directory for cached data

make_dir

Make the directory if needed, logical

save

Save the cache directory in the .Renviron file for persistence across R sessions

reset

Change to the default location

Details

caladaptr has the ability to store copies of objects downloaded from Cal-Adapt. An example of this would be the raster series data catalog and the geometries of AOI Presets.

NOTE: In general caladaptr does not cache climate data fetched from Cal-Adapt. Every time you call a function that fetches data (e.g., ca_getvals_tbl), data is retrieved fresh. The exception to this is ca_getvals_db, which has arguments you can pass to cache retrieved values into a local SQLite database to explicitly avoid downloading data twice.

The default location for the cache directory is given by R_user_dir("caladaptr", "cache"). A custom location can be set with ca_setcache.

Functions

  • ca_setcache: Set cache directory