R/vech.R

vech <-
function (x) {
    x <- as.matrix(x)
    if (dim(x)[1] != dim(x)[2]) {
      stop("Non-square matrix passed to vech().\n")
    }
    output <- x[lower.tri(x, diag = TRUE)]
    dim(output) <- NULL
    return(output)
  }

Try the skewMLRM package in your browser

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

skewMLRM documentation built on Nov. 24, 2021, 9:07 a.m.