R/xpndMat.R

Defines functions xpndMat

Documented in xpndMat

###
### R routines for the R package mixmeta (c)
#
xpndMat <-
function(vech) {
#
################################################################################
#
  dim <- (-1+sqrt(1+8*length(vech)))/2
  if(dim%%1!=0L) stop("dimension of 'vech' not consistent")
  mat <- matrix(nrow=dim,ncol=dim)
  mat[lower.tri(mat,diag=TRUE)] <- as.matrix(vech)
  mat[upper.tri(mat)] <- t(mat)[upper.tri(mat)]
#
  mat
}

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.