Cut out a part of a SpatRaster with a SpatExtent, or another object from which an extent can be obtained. You can only extract rectangular areas, but see mask for setting cell values within SpatRaster to NA.
Usage
# S4 method for SpatRaster,ANY
crop(x, y, snap="near", filename="", overwrite=FALSE, wopt=list(), ...)
# S4 method for SpatVector,SpatVector
crop(x, y, ...)
Arguments
x
SpatRaster or SpatVector
y
SpatExtent or other object that has a SpatExtent; or SpatVector if x is a SpatVector