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
}

Try the ecodist package in your browser

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

ecodist documentation built on Nov. 2, 2023, 6:01 p.m.