
Last chance! 50% off unlimited learning
Sale ends in
Shift a SpatRaster, SpatVector or SpatExtent to another location.
# S4 method for SpatRaster
shift(x, dx=0, dy=0, filename="", ...)# S4 method for SpatVector
shift(x, dx=0, dy=0)
# S4 method for SpatExtent
shift(x, dx=0, dy=0)
Same as x
SpatRaster, SpatVector or SpatExtent
numeric. The shift in horizontal direction
numeric. The shift in vertical direction
character. Output filename
additional arguments for writing files as in writeRaster
flip
, rotate
r <- rast(xmin=0, xmax=1, ymin=0, ymax=1)
r <- shift(r, dx=1, dy=-1)
e <- ext(r)
shift(e, 5, 5)
Run the code above in your browser using DataLab