Learn R Programming

infoDecompuTE (version 0.5.1)

tr: Trace of the Matrix

Description

Compute the trace of the square matrix.

Usage

tr(X)

Arguments

X
a square matrix.

Value

This function returns a numeric vector with length of one.

References

John J, Williams E (1987). Cyclic and computer generated Designs. Second edition. Chapman & Hall.

See Also

diag

Examples

Run this code
m = matrix(1, nrow = 10, ncol = 10)
tr(m)   

Run the code above in your browser using DataLab