Cells from extent, and vice versa
cellsFromExtent.RdcellsFromExtent returns the cell numbers for a Raster* object that are within a specfied extent (rectangular area), supply an object of class Extent, or another Raster* object.
extentFromCells returns an Extent object from a Raster* object and cell numbers. All cells are within the returned Extent.
Arguments
- object
A Raster* object
- extent
An object of class Extent (which you can create with newExtent(), or another Raster* object )
- expand
Logical. If
TRUE,NAis returned for (virtual) cells implied bybndbox, that are outside the RasterLayer (object). IfFALSE, only cell numbers for the area whereobjectandbndboxoverlap are returned (see intersect)- cells
numeric. A vector of cell numbers