array_bind | R Documentation |
Bind a number of arrays, usually by their last dimension. This is useful for binding together the sorts of arrays produced by dust and mcstate's simulation functions.
array_bind(..., arrays = list(...), dimension = NULL)
... |
Any number of arrays. All dimensions must the the same, except for the dimension being bound on which may vary. |
arrays |
As an alternative to using |
dimension |
The dimension to bind on; by default |
A single array object
# Consider two matricies; this is equivalent to rbind and is
# pretty trivial
m1 <- matrix(1, 4, 5)
m2 <- matrix(2, 4, 2)
mcstate::array_bind(m1, m2)
# For a 4d array though it's less obvious
a1 <- array(1, c(2, 3, 4, 5))
a2 <- array(2, c(2, 3, 4, 1))
a3 <- array(3, c(2, 3, 4, 3))
dim(mcstate::array_bind(a1, a2, a3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.