R/tr.R

Defines functions tr

Documented in tr

# Trace operation



##' Trace of the Matrix
##' 
##' Compute the trace of the square matrix.
##' 
##' 
##' @param X a square matrix.
##' @return A numeric value.
##' @author Kevin
##' @seealso \code{\link{diag}}
##' @references John J, Williams E (1987). \emph{Cyclic and computer generated
##' Designs}. Second edition. Chapman & Hall.
##' @examples
##' 
##' 
##' m = matrix(1, nrow = 10, ncol = 10)
##' tr(m)   
##' 
##' 
##' @export tr
tr <- function(X) sum(diag(X)) 

Try the infoDecompuTE package in your browser

Any scripts or data that you put into this service are public.

infoDecompuTE documentation built on April 14, 2020, 7:08 p.m.