blockdiag: Construct a block-diagonal matrix.

View source: R/linpk.R

blockdiagR Documentation

Construct a block-diagonal matrix.

Description

Construct a block-diagonal matrix.

Usage

blockdiag(..., .names = NULL, .colnames = .names, .rownames = .names)

Arguments

...

Any number of square matrices making up the diagonal blocks of the matrix.

.names, .colnames, .rownames

Optionally, specify the row and column names of the resulting matrix.

Value

A block-diagonal matrix.

Examples

blockdiag(matrix(1, 2, 2), 2, matrix(3, 4, 4))
blockdiag(c(a=5, b=6), Diag(c=7, d=8), LTmat(c(1, 2, 3), .names=c("e", "f")))
blockdiag(a=5, b=6, Diag(c=7, d=8), LTmat(c(1, 2, 3), .names=c("e", "f")))
blockdiag(5, 6, Diag(7, 8), LTmat(c(1, 2, 3)), .names=c("a", "b", "c", "d", "e", "f"))

benjaminrich/linpk documentation built on April 18, 2024, 2:13 a.m.