Rasters 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.

.prepareFileBackedRaster(obj, repoDir = NULL,
  compareRasterFileLength = 1e+06, ...)



The raster object to save to the repository.


Character denoting an existing directory in which an artifact will be saved.


Numeric. Optional. When there are Rasters, that have file-backed storage, this is passed to the length arg in digest when determining if the Raster file is already in the database. Note: uses digest for file-backed Raster. Default 1e6. Passed to .prepareFileBackedRaster.


passed to archivist::saveToRepo


A raster object and its newly located file backing. Note that if this is a legitimate archivist 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.