Shift
Shift the location of a Raster* of vector type Spatial* object in the x and/or y direction methods
## S4 method for signature 'Raster' shift(x, dx=0, dy=0, filename='', ...) ## S4 method for signature 'SpatialPolygons' shift(x, dx=0, dy=0, ...) ## S4 method for signature 'SpatialLines' shift(x, dx=0, dy=0, ...) ## S4 method for signature 'SpatialPoints' shift(x, dx=0, dy=0, ...)
x
: Raster* or Spatial* objectdx
: numeric. The shift in horizontal directiondy
: numeric. The shift in vertical directionfilename
: character file name (optional)...
: if x
is a Raster* object: additional arguments as for writeRaster
Same object type as x
flip
, rotate
, and the elide function in the maptools package
r <- raster() r <- shift(r, dx=1, dy=-1)