blkDiag {swCRTdesign} | R Documentation |
Block Diagonal Matrix Generator
Description
blkDiag
returns block diagonal matrix based on specified square blocks (either as an array or a list).
Usage
blkDiag(z)
Arguments
z |
numeric (array or list): User-specified matrices to be combined into one block diagonal matrix. |
Value
numeric (matrix): blkDiag
gives a block diagonal matrix.
Author(s)
James P Hughes and Navneet R Hakhu
Examples
library(swCRTdesign)
# Example 1 (input: array)
blkDiag.Ex1.array <- blkDiag( z=array(1:12, c(2,2,3)) )
blkDiag.Ex1.array
# Example 2 (input: list)
blkDiag.Ex2.list <- blkDiag( z=list(matrix(1,2,2), diag(2,3), matrix(3,4,4)) )
blkDiag.Ex2.list
[Package swCRTdesign version 4.0 Index]