fromDisk
is TRUE
if the data source is a file on disk; and FALSE
if the object only exists in memory.
inMemory
is TRUE
if all values are currently in memory (RAM); and FALSE
if not (in which case they either are on disk, or there are no values).
hasValues
is TRUE
if the object has cell values.fromDisk(x)
inMemory(x)
hasValues(x)
rs <- raster(system.file("external/test.grd", package="raster"))
inMemory(rs)
fromDisk(rs)
rs <- readAll(rs)
inMemory(rs)
fromDisk(rs)
rs <- rs + 1
inMemory(rs)
fromDisk(rs)
rs <- raster(rs)
inMemory(rs)
fromDisk(rs)
rs <- setValues(rs, 1:ncell(rs))
inMemory(rs)
fromDisk(rs)
rs <- writeRaster(rs, filename='test', overwrite=TRUE)
inMemory(rs)
fromDisk(rs)
Run the code above in your browser using DataLab