R/fixdmat.R

Defines functions fixdmat

Documented in fixdmat

fixdmat <- function(v)
{
# Converts a row-wise distance vector to a full distance matrix.
    n <- (1 + sqrt(1 + 8 * length(v)))/2
    dist.m <- matrix(0, n, n)
    dist.m[row(dist.m) < col(dist.m)] <- v
    dist.m <- dist.m + t(dist.m)
    dist.m
}
phiala/ecodist documentation built on Nov. 5, 2023, 10:47 a.m.