R/full.R

full <-
function (v) {
  n <- (1 + sqrt(1 + 8 * length(v)))/2
  if (abs(n - round(n)) > 1e-07) 
    stop("Matrix not square.")
  n <- round(n)
  full <- matrix(0, n, n)
  full[lower.tri(full)] <- v
  full2 <- t(full)
  diag(full2) <- 0
  full + full2
}

Try the RPANDA package in your browser

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

RPANDA documentation built on Oct. 24, 2022, 5:06 p.m.