Learn R Programming

plsdof (version 0.3-2)

tr: Trace of a matrix

Description

This function computes the trace of a matrix.

Usage

tr(M)

Value

The trace of the matrix M.

Arguments

M

square matrix

Author

Nicole Kraemer

Examples

Run this code

M<-matrix(rnorm(8*8),ncol=8)
tr.M<-tr(M)

Run the code above in your browser using DataLab