R/matrix_trace.R

Defines functions matrix_trace

matrix_trace <- function(x) {

  #' computes the trace of a matrix
  #'
  #' @param x a square matrix
  #' @return returns the trace of the matrix x
  #' @noRd

  sum(diag(x))
}

Try the summclust package in your browser

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

summclust documentation built on Aug. 10, 2023, 9:07 a.m.