| shift | R Documentation |
Shift a SpatRaster, SpatVector or SpatExtent to another location.
## S4 method for signature 'SpatRaster'
shift(x, dx=0, dy=0, filename="", to, ...)
## S4 method for signature 'SpatVector'
shift(x, dx=0, dy=0, to)
## S4 method for signature 'SpatExtent'
shift(x, dx=0, dy=0, to)
x |
SpatRaster, SpatVector or SpatExtent |
dx |
numeric. The shift in horizontal direction |
dy |
numeric. The shift in vertical direction |
to |
SpatExtent, or an object from which an extent can be extracted (see |
filename |
character. Output filename |
... |
additional arguments for writing files as in |
Same as x
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)
# center on another object or on coordinates
e2 <- ext(10, 12, 4, 8)
shift(e, to=e2)
shift(e, to=c(11, 6))
shift(e, to=c(11, NA))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.