add.diag {MoBPS} | R Documentation |
Function to add numeric to the diagonal of a matrix
add.diag(M, d)
M |
Matrix |
d |
Vector to add to the diagonal of the matrix |
Matrix with increased diagonal elements
Matrix with modified diagonal entries
A <- matrix(c(1,2,3,4), ncol=2)
B <- add.diag(A, 5)