| merge | R Documentation |
Complementing existing merge methods, e.g. terra::merge() for Spat*
objects, which typically work with one or two inputs only, this function
accepts a list of objects that are to be merged together.
## S4 method for signature 'list,missing' merge(x, by = 1L, all = TRUE, ...)
x |
A |
by, all |
See |
... |
Additional arguments passed to the underlying merge method (e.g.
arguments compatible with |
A merged object (e.g. a new Spat* object with a larger spatial extent).
Florian Detsch
do.call(), Reduce().
## `SpatRaster` input
dms = list.files(system.file("extdata", package = "Orcs")
, pattern = "ASTGTM2.*dem.tif$", full.names = TRUE)
dms = lapply(dms, terra::rast)
dem = merge(dms[3:4])
terra::plot(dem)
## data.frame input
mrg = merge(list(iris, iris, iris)
, by = c("Species", "Sepal.Length", "Petal.Width"))
head(mrg)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.