Displaying 1 result from an estimated 1 matches for "lowleft".
Did you mean:
lleft
2004 May 27
2
block diagonal matrix function
...ake an arbitrary number of matrices as
inputs?
TIV
Robin
"blockdiag" <-
function (m1, m2, p.tr = 0, p.ll = 0)
{
## p.tr and p.ll are padding values
topleft <- m1
topright <- matrix(p.tr, nrow(m1), ncol(m2))
colnames(topright) <- colnames(m2)
lowleft <- matrix(p.ll, nrow(m2), ncol(m1))
lowright <- m2
rbind(cbind(topleft, topright), cbind(lowleft, lowright))
}
m1 <-
structure(c(1, 1, 3, 1, 3, 4), .Dim = as.integer(c(2, 3)), .Dimnames = list(
c("a", "b"), c("x", "y", "z"))...