Learn R Programming

raster (version 1.8-3)

expand: Expand

Description

Expand returns an RasterLayer with a larger spatial extent. The output RasterLayer has the outer minimum and maximum coordinates of the input RasterLayer and Extent arguments. Thus, all of the cells of the original raster are included. See crop if you (also) want to remove rows or columns.

Usage

expand(x, y, ...)

Arguments

x
a RasterLayer object
y
Extent object, or any object that is or has an Extent object, or an object from which it can be extracted (such as sp objects)
...
additional arguments. See Details.

Value

  • A new RasterLayer 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 rll{ filename filename for the output RasterLayer. Default='' overwrite Logical. If TRUE, "filename" will be overwritten if it exists format Character. Output file type. See writeRaster datatype Character. Output data type. See dataType progress Character. "text", "window", or "" (the default, no progress bar) }

See Also

crop, merge

Examples

Run this code
r <- raster(xmn=-150, xmx=-120, ymx=60, ymn=30, ncol=36, nrow=18)
r[] <- 1:ncell(r)
bb <- extent(-180, 0, 0, 90)
re <- expand(r, bb)

Run the code above in your browser using DataLab