shift: Shift

Description Usage Arguments Value See Also Examples

Description

Shift the location of a Raster* of vector type Spatial* object in the x and/or y direction

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## 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,  ...)

Arguments

x

Raster* or Spatial* object

dx

numeric. The shift in horizontal direction

dy

numeric. The shift in vertical direction

filename

character file name (optional)

...

if x is a Raster* object: additional arguments as for writeRaster

Value

Same object type as x

See Also

flip, rotate, and the elide function in the maptools package

Examples

1
2
r <- raster()
r <- shift(r, dx=1, dy=-1)

Example output

Loading required package: sp

raster documentation built on Jan. 5, 2021, 3:01 a.m.