#' Vech function
#'
#' Details.
#' @title calculating a vector
#' @param X data matrix
#' @param diag diagonal values
#' @return out a matrix
#' @author Feng Li, Department of Statistics, Stockholm University, Sweden.
#' @export
vech <- function(X, diag = TRUE)
{
out <- matrix(X[as.vector(lower.tri(X, diag = diag))])
return(out)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.