Provides a wrapper around raster::mosaic() that cleans up any temporary intermediate files used, and sets the layer name of the resulting raster.

mosaic2(x, y, ...)

# S4 method for class 'RasterLayer,RasterLayer'
mosaic2(
  x,
  y,
  ...,
  fun,
  tolerance = 0.05,
  filename = NULL,
  layerName = "layer",
  inRAM = FALSE
)

# S4 method for class 'SpatRaster,SpatRaster'
mosaic2(
  x,
  y,
  ...,
  fun,
  tolerance = 0.05,
  filename = NULL,
  layerName = "layer",
  inRAM = FALSE
)

Arguments

x

Raster* object

y

Raster* object

...

Additional Raster or Extent objects.

fun

Function (e.g., mean, min, or max, that accepts a na.rm argument).

tolerance

Numeric. Permissible difference in origin (relative to the cell resolution). See all.equal().

filename

Character. Output filename (optional).

layerName

Character. Name of the resulting raster layer.

inRAM

Logical (default FALSE) indicating whether function operations should be performed in memory or, if TRUE, using temporary files.

Author

Alex Chubaty