add.diag: Add something to the diagonal

Description Usage Arguments Value Examples

View source: R/add.diag.R

Description

Function to add numeric to the diagonal of a matrix

Usage

1
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

1
2
A <- matrix(c(1,2,3,4), ncol=2)
B <- add.diag(A, 5)

MoBPS documentation built on Nov. 9, 2021, 5:08 p.m.

Related to add.diag in MoBPS...