band {bnbc} | R Documentation |
Get or set band from matrix.
band(mat, band.no) band(mat, band.no) <- value
mat |
A matrix. |
band.no |
Integer specifying which matrix band. |
value |
A scalar or vector equal in length to the matrix band. |
A matrix band is the set of elements in a matrix from a specific off-diagonal.
A matrix band in the form of a vector.
mat <- matrix(1:9, 3, 3) band(mat, band.no = 2) mat band(mat, band.no = 2) <- c(9,10) mat data(cgEx) tact.1 <- contacts(cgEx)[[1]] b2 <- band(tact.1, 2) band(tact.1, 2) <- b2