Learn R Programming

fake (version 1.4.0)

BlockDiagonal: Block diagonal matrix

Description

Generates a binary block diagonal matrix.

Usage

BlockDiagonal(pk)

Value

A binary block diagonal matrix.

Arguments

pk

vector encoding the grouping structure.

See Also

Other block matrix functions: BlockMatrix(), BlockStructure()

Examples

Run this code
# Example 1
BlockDiagonal(pk = c(2, 3))

# Example 2
BlockDiagonal(pk = c(2, 3, 2))

Run the code above in your browser using DataLab