Last chance! 50% off unlimited learning
Sale ends in
x
is a Raster* object, the Extent is aligned to x
. Areas included in y
but outside the extent of x
are ignored (see expand
if you want a larger area)## S3 method for class 'Raster':
crop(x, y, filename="", snap='near', ...)
## S3 method for class 'Spatial':
crop(x, y, ...)
alignExtent
writeRaster
extent
function. New Extent objects can be also be created with function extent
and drawExtent
by clicking twice on a plot.expand
, merge
r <- raster(nrow=45, ncol=90)
r[] <- 1:ncell(r)
e <- extent(-160, 10, 30, 60)
rc <- crop(r, e)
Run the code above in your browser using DataLab