Learn R Programming

optedr (version 2.2.0)

tr: Trace

Description

Return the mathematical trace of a matrix, the sum of its diagonal elements.

Usage

tr(M)

Value

The trace of the matrix.

Arguments

M

The matrix from which to calculate the trace.