abind | R Documentation |
Combine a sequence of (sparse) arrays, matrices, or vectors into a single sparse array of the same or higher dimension.
abind_simple_sparse_array(..., MARGIN = 1L)
extend_simple_sparse_array(x, MARGIN = 0L)
... |
R objects of (or coercible to) class |
MARGIN |
The dimension along which to bind the arrays. |
x |
An object of class |
abind_simple_sparse_array
automatically extends the dimensions
of the elements of ‘...’ before it combines them along the
dimension specified in MARGIN
. If a negative value is specified
first all elements are extended left of the target dimension.
extend_simple_sparse_array
inserts one (or more) one-level
dimension(s) into x
to the right of the position(s) specified in
MARGIN
, or to the left if specified in negative terms. Note that
the target positions must all be in the range of the dimensions of x
(see Examples).
An object of class simple_sparse_array
where the dimnames
are taken from the elements of ‘...’.
Christian Buchta
simple_sparse_array
for sparse arrays.
## automatic
abind_simple_sparse_array(1:3, array(4:6, c(1,3)))
abind_simple_sparse_array(1:3, array(4:6, c(3,1)), MARGIN = 2L)
## manual
abind_simple_sparse_array(1:3, 4:6)
abind_simple_sparse_array(1:3, 4:6, MARGIN = -2L) ## by columns
abind_simple_sparse_array(1:3, 4:6, MARGIN = -1L) ## by rows
##
a <- as.simple_sparse_array(1:3)
a
extend_simple_sparse_array(a, c( 0L, 1L))
extend_simple_sparse_array(a, c(-1L,-2L)) ## the same
extend_simple_sparse_array(a, c( 1L, 1L))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.