R/vechMat.R

Defines functions vechMat

Documented in vechMat

###
### R routines for the R package mixmeta (c)
#
vechMat <-
function(mat, diag=TRUE) {
#
################################################################################
#
  if(!is.matrix(mat)) mat <- as.matrix(mat)
  if(diff(dim(mat))!=0) stop("Non-square matrix")
#
  mat[lower.tri(mat,diag=diag)]
}

Try the mixmeta package in your browser

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

mixmeta documentation built on Oct. 16, 2021, 5:09 p.m.