| tr | R Documentation | 
Methods to efficiently calculate a matrix trace depending on the class of matrix.
tr(X, ...)
## Default S3 method:
tr(X, ...)
## S3 method for class 'dgCMatrix'
tr(X, ...)
## S3 method for class 'dsCMatrix'
tr(X, ...)
| X | A matrix. | 
| ... | Additional arguments. | 
A numeric value for the sum of the diagonal elements.
tr(default): Default method
tr(dgCMatrix): Method for matrix X of class Matrix:::dgCMatrix
tr(dsCMatrix): Method for matrix X of class Matrix:::dsCMatrix
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.