Learn R Programming

lava (version 1.8.0)

tr: Trace operator

Description

Calculates the trace of a square matrix.

Usage

tr(x, ...)

Value

numeric

Arguments

x

Square numeric matrix

...

Additional arguments to lower level functions

Author

Klaus K. Holst

See Also

Examples

Run this code

tr(diag(1:5))

Run the code above in your browser using DataLab