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