powered by
Create a block diagonal matrix
bdiagMatrix(mlist, fill = 0)
a block diagonal matrix
a list of matrices
value to fill the non-diagnoal elements
bdiag in Matrix
bdiag
m1 <- bdiagMatrix(list(matrix(1:4, 2), diag(3))) m2 <- bdiagMatrix(list(matrix(1:4, 2), diag(3)),fill = NA)
Run the code above in your browser using DataLab