Calculates the trace of a matrix
tr(mat)
a square matrix.
The trace of the matrix, i.e. the sum of its diagonal elements, is returned.
# NOT RUN { tr(cbind(1,1:3,4:2)) # 5 # }
Run the code above in your browser using DataCamp Workspace