bind: Row, column, and block-diagonal binding for structured sparse...

Description Usage Arguments See Also Examples

Description

Row, column, and block-diagonal binding for structured sparse matrices

Repeat structured sparse matrix

Usage

1
2
3
4
5
6
7
bind(..., type = c("row", "col", "diag"))

.bind(mats, type = c("row", "col", "diag"))

## S3 method for class 'strucMatrix'
rep(x, times, type = c("row", "col", "diag"),
  repVals = FALSE, ...)

Arguments

...

list of strucMatrix objects (but not used for rep.strucMatrix)

type

type of binding

mats

list of strucMatrix matrix objects

x

strucMatrix object

times

like rep

repVals

should the unique values (x$vals) be repeated too? in other words, do you want to have each replicate to have guaranteed identical values (FALSE, the default), or do you want each replicate to be settable to it's own values (TRUE)?

See Also

Other matrixCombining: kr, kron, kronecker,strucMatrix,strucMatrix-method; strucMatrixRowSubset, subset.strucMatrix

Other matrixCombining: kr, kron, kronecker,strucMatrix,strucMatrix-method; strucMatrixRowSubset, subset.strucMatrix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
set.seed(1)
X <- strucMatrix(c(1, 2, 1, 2), c(1, 1, 2, 2), 1:4, rnorm(4))
Y <- strucMatrix(c(1, 2, 1), c(1, 1, 2), 1:3, rnorm(3))
Z <- strucMatrix(c(1, 2), c(1, 2), 1:2, rnorm(2))
(bindDiag <- bind(X, Y, Z, type = "diag"))
(bindRow  <- bind(X, Y, Z, type = "row"))
(bindCol  <- bind(X, Y, Z, type = "col"))
set.seed(1)
X <- strucMatrix(c(1, 2, 1, 2), c(1, 1, 2, 2), 1:4, rnorm(4))
Y <- strucMatrix(c(1, 2, 1), c(1, 1, 2), 1:3, rnorm(3))
Z <- strucMatrix(c(1, 2), c(1, 2), 1:2, rnorm(2))
(repDiag <- rep(X, 3, type = "diag"))
(repRow  <- rep(X, 3, type = "row"))
(repCol  <- rep(X, 3, type = "col"))

stevencarlislewalker/lme4ord documentation built on May 30, 2019, 4:43 p.m.