blkDiag: Block Diagonal Matrix Generator

Description Usage Arguments Value Author(s) Examples

View source: R/blkDiag.R

Description

blkDiag returns block diagonal matrix based on specified square blocks (either as an array or a list).

Usage

1

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

1
2
3
4
5
6
7
8
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

swCRTdesign documentation built on Oct. 30, 2019, 11:24 a.m.