merge {Orcs} | R Documentation |
Merge Objects Stored in a List
Description
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.
Usage
## S4 method for signature 'list,missing'
merge(x, by = 1L, all = TRUE, ...)
Arguments
x |
A |
by , all |
See |
... |
Additional arguments passed to the underlying merge method (e.g.
arguments compatible with |
Value
A merged object (e.g. a new Spat*
object with a larger spatial extent).
Author(s)
Florian Detsch
See Also
Examples
## `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)
[Package Orcs version 1.2.3 Index]