tr: Matrix trace

Description Usage Arguments Value Author(s) Examples

View source: R/tr.R

Description

Calculates the trace of a matrix

Usage

1
tr(M)

Arguments

M

a matrix

Value

returns the sum of the diagonal elements

Author(s)

Michael Friendly

Examples

1
2
M <- matrix(sample(1:9), 3,3)
tr(M)

mvinfluence documentation built on May 31, 2017, 1:59 a.m.