flip

0th

Percentile

Flip

Flip the values of a Raster* object by inverting the order of the rows (direction=y) or the columns direction='x'.

Keywords
spatial
Usage
flip(x, direction, ...)
Arguments
x

Raster* object

direction

Character. 'y' or 'x'; or 1 (=x) or 2 (=y)

...

Additional arguments as for writeRaster

Value

RasterLayer or RasterBrick

See Also

transpose: t, rotate

Aliases
  • flip
  • flip,RasterLayer-method
  • flip,RasterStackBrick-method
Examples
# NOT RUN {
r <- raster(nrow=18, ncol=36)
m <- matrix(1:ncell(r), nrow=18)
r[] <- as.vector(t(m))
rx <- flip(r, direction='x')
r[] <- as.vector(m)
ry <- flip(r, direction='y')
# }
Documentation reproduced from package raster, version 2.9-5, License: GPL (>= 3)

Community examples

Looks like there are no examples yet.