powered by
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)
# S4 method for SpatVector shift(x, dx=0, dy=0)
# S4 method for SpatExtent shift(x, dx=0, dy=0)
Same as x
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
writeRaster
flip, rotate
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