Merge Raster* objects to form a new Raster object with a larger spatial extent. If objects overlap, the values get priority in the same order as the arguments, but NA values are ignored (except when overlap=FALSE)
See the merge,Spatial,data.frame-method for merging a data.frame with attributes of Spatial objects and the merge,SpatialPolygons,SpatialPolygons-method for appending and perhaps spatially intersecting polygons.
Usage
## S3 method for class 'Raster,Raster':
merge(x, y, ..., tolerance=0.05, filename="", format, datatype, overwrite, progress, overlap=TRUE, ext=NULL)
Arguments
x
Raster* object
y
Raster* object
...
Additional Raster objects
tolerance
Numeric. Permissable difference in origin (relative to the cell resolution). See all.equal
filename
Character. output filename
overwrite
Logical. If TRUE, "filename" will be overwritten if it exists
format
Character. output file type. Either 'raster', 'ascii' or a supported GDAL 'driver' name see writeFormats
Character. "text", "window", or "" (the default, no progress bar)
overlap
Logical. If FALSE values of overlapping objects are based on the first layer, even if they are NA
ext
Extent object (optional) to limit the output to that extent
Value
RasterLayer or RasterBrick
Details
The Raster objects must have the same origin and resolution. In areas where the Raster objects overlap, the values of the Raster object that is first in the sequence of arguments will be retained. If you'd rather use the average of cell values, or do another computation, you can use mosaic instead of merge.