Align an SpatExtent with a SpatRaster This can be useful to create a new SpatRaster with the same origin and resolution as an existing SpatRaster. Do not use this to force data to match that really does not match (use e.g. resample or (dis)aggregate for this).
It is also possible to align a SpatExtent to a clean divisor.
Usage
# S4 method for SpatExtent,SpatRaster
align(x, y, snap="near")
# S4 method for SpatExtent,numeric
align(x, y)
Value
SpatExtent
Arguments
x
SpatExtent
y
SpatRaster or numeric
snap
Character. One of "near", "in", or "out", to determine in which direction the extent should be aligned. To the nearest border, inwards or outwards