Stack multiple worldMatrix
into a worldArray
.
stackWorlds(...)
# S4 method for worldMatrix
stackWorlds(...)
worldMatrix
objects. If passed as unnamed objects, then the function
will attempt to use their object names as layer names. Alternatively, to be more
reliable, these can be passed as named arguments. See examples.
worldArray
object.
The worldMatrix
objects must all have the same extents.
w1 <- createWorld(minPxcor = 0, maxPxcor = 4, minPycor = 0, maxPycor = 4, data = 1:25)
w2 <- createWorld(minPxcor = 0, maxPxcor = 4, minPycor = 0, maxPycor = 4, data = 25:1)
w3 <- stackWorlds(w1, w2)
plot(w3)
# pass named arguments to specify a different name than the object name
w4 <- stackWorlds(layer1 = w1, layer2 = w2)