setExtent {raster} | R Documentation |
Set the extent of a RasterLayer
Description
setExtent sets the extent of a Raster* object. Either by providing a new Extent object or by setting the extreme coordinates one by one.
Usage
setExtent(x, ext, keepres=FALSE, snap=FALSE)
extent(x) <- value
Arguments
x |
A Raster* object |
ext |
An object of class Extent (which you can create with |
keepres |
logical. If |
snap |
logical. If |
value |
An object of class Extent (which you can create with |
Value
a Raster* object
See Also
Examples
r <- raster()
bb <- extent(-10, 10, -20, 20)
extent(r) <- bb
r <- setExtent(r, bb, keepres=TRUE)
[Package raster version 3.6-26 Index]