Description Usage Arguments Details Value See Also Examples
blockmatrix
creates a block-matrix from the given
set of values
as.bmatrix
attempts to turn its
argument into a block-matrix
is.bmatrix
tests
if its argument is a (strict) block-matrix
1 2 3 4 5 6 | blockmatrix(data, rowparts = NULL, colparts = NULL,
parts = NULL, dims = NULL)
is.blockmatrix(x)
as.blockmatrix(x, ...)
|
data |
a matrix, a vector, or a blockvector |
rowparts |
vector of row partitions |
colparts |
vector of column partitions |
parts |
optional integer positive vector with the partitions |
dims |
optional integer positive vector with the block structure |
x |
an R object |
... |
additional arguments to be passed to
|
When data
is a blockvector, the return blockmatrix
is a column-block (i.e. vertical) matrix
An object of class "blockmatrix"
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # create a regular matrix
a = matrix(runif(20), 5, 4)
# convert 'a' into a block-matrix
A = blockmatrix(a, c(2, 3), c(2, 2))
A
# test if block-matrix
is.bmatrix(a) # FALSE
is.bmatrix(A) # TRUE
# generate a matrix
m = matrix(1:9, 3, 3)
# convert 'm' into a block-matrix (one block)
M = as.bmatrix(m, 3, 3)
M
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.