Nothing
#' Trace
#'
#' Return the trace of a square matrix
#'
#' @param x a square matrix
#' @param ... arguments passed to \code{\link{sum}}
#'
#' @return The trace, the sum of the diagonal elements, of the square matrix
#' \code{x}
#'
tr <- function(x, ...) {
stopifnot(is.matrix(x))
stopifnot(nrow(x) == ncol(x))
sum(diag(x), ...)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.