R/cache-helpers.R
prepareFileBackedRaster.RdRasters are sometimes file-based, so the normal save and copy and assign
mechanisms in R don't work for saving, copying and assigning.
This function creates an explicit file copy of the file that is backing the raster,
and changes the pointer (i.e., filename(object)) so that it is pointing
to the new file.
The raster object to save to the repository.
Character denoting an existing directory in which an artifact will be saved.
Logical. Should the raster be saved to disk, overwriting existing file.
If using a database backend, drv must be an object that
inherits from DBIDriver (e.g., RSQLite::SQLite).
an optional DBIConnection object, as returned by dbConnect().
Numeric, -1 silent (where possible), 0 being very quiet,
1 showing more messaging, 2 being more messaging, etc.
Default is 1. Above 3 will output much more information about the internals of
Caching, which may help diagnose Caching challenges. Can set globally with an
option, e.g., options('reproducible.verbose' = 0) to reduce to minimal
Not used
A raster object and its newly located file backing.
Note that if this is a legitimate Cache repository, the new location
will be a subdirectory called rasters/ of repoDir/.
If this is not a repository, the new location will be within repoDir.