Learn R Programming

raster (version 1.8-3)

rotate: Rotate

Description

Rotate a Raster* object that has x coordinates (longitude) from 0 to 360, to standard coordinates between -180 and 180 degrees. Longitude between 0 and 360 is frequently used in data from global climate models.

Usage

rotate(x, ...)

Arguments

x
a Raster* object
...
Additional arguments, see Details

Value

  • A RasterLayer or a RasterBrick object, and, in some cases, the side effect of a new file on disk.

Details

The following additional arguments can be passed, to replace default values for this function lll{ filename Character. Output filename format Character. Output file type. See writeRaster datatype Character. Output data type. See dataType overwrite Logical. If TRUE, "filename" will be overwritten if it exists progress Character. "text", "window", or "" (the default, no progress bar) }

See Also

flip

Examples

Run this code
r <- raster(nrow=18, ncol=36)
m <- matrix(1:ncell(r), nrow=18)
r[] <- as.vector(t(m))
extent(r) <- extent(0, 360, -90, 90)
rr <- rotate(r)

Run the code above in your browser using DataLab