Split a SpatRaster by layer, or a SpatVector by attributes. You can also split the geometry of a polygon SpatVector with another SpatVector.
methods
## S4 method for signature 'SpatRaster,ANY'split(x, f)## S4 method for signature 'SpatVector,ANY'split(x, f)## S4 method for signature 'SpatVector,SpatVector'split(x, f)
Arguments
x: SpatRaster or SpatVector
f: If x is a SpatRaster: a vector of the length nlyr(x). If x is a SpatVector: a field (variable) name or a vector of the same length as x; or, if x is a SpatVector of polygons, a SpatVector of lines or polygons to split the polygon geometries