Create a block-diagonal matrix of ones.

bdsBlock(id, group)

Arguments

id

the identifier list. This will become the dimnames of the final matrix, and must be a set of unique values. It's length determines the dimension of the final matrix

group

a vector giving the grouping structure. All rows/cols belonging to a given group will form a block of 1's in the final matrix.

Value

a block-diagonal matrix of class bdsmatrix

See also

bdsmatrix, bdsI

Examples