tr: Matrix trace

Description Usage Arguments Value Author(s) Examples

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)


Search within the mvinfluence package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.