Learn R Programming

gMCP (version 0.5-0)

bdiagNA: Create a Block Diagonal Matrix with NA outside the diagonal

Description

Build a block diagonal matrix given several building block matrices, but with NA values outside the diagonal.

Usage

bdiagNA(...)

Arguments

...
individual matrices or a list of matrices.

Value

  • A block diagonal matrix with NA values outside the diagonal.

Details

This function is usefull to build the correlation matrices, when only partial knowledge of the correlation exists.

See Also

graphMCP, graph2matrix

Examples

Run this code
bdiagNA(diag(3), matrix(1/2,nr=3,nc=3), diag(2))

Run the code above in your browser using DataLab