add.diag {MoBPS} | R Documentation |
Add something to the diagonal
Description
Function to add numeric to the diagonal of a matrix
Usage
add.diag(M, d)
Arguments
M |
Matrix |
d |
Vector to add to the diagonal of the matrix |
Value
Matrix with increased diagonal elements
Matrix with modified diagonal entries
Examples
A <- matrix(c(1,2,3,4), ncol=2)
B <- add.diag(A, 5)
[Package MoBPS version 1.6.64 Index]