raster (version 1.1.7)

expand: Expand

Description

Expand returns an RasterLayer with a larger spatial extent. The output RasterLayer has the extreme minimum and maximum coordinates of the input RasterLayer and input Extent arguments. Thus, all of the cells of the original raster are included.

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. Valid values are "text", "tcltk", "windows" (on that platform only) and "" }

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 DataCamp Workspace