mxtr function

Numerical and Symbolic Matrix Trace

Numerical and Symbolic Matrix Trace

Computes the trace of a numeric or character matrix.

mxtr(x)

Arguments

  • x: numeric or character matrix.

Returns

numeric or character.

Examples

### numeric matrix x <- matrix(1:4, nrow = 2) mxtr(x) ### character matrix x <- matrix(letters[1:4], nrow = 2) mxtr(x)

References

Guidotti E (2022). "calculus: High-Dimensional Numerical and Symbolic Calculus in R." Journal of Statistical Software, 104(5), 1-37. tools:::Rd_expr_doi("10.18637/jss.v104.i05")

See Also

Other matrix algebra: mxdet(), mxinv(), mx()

  • Maintainer: Emanuele Guidotti
  • License: GPL-3
  • Last published: 2023-03-09