R/distconnected.R

Defines functions `distconnected`

`distconnected` <-
    function(dis, toolong = 1, trace = TRUE)
{
    n <- attr(dis, "Size")
    out <- .C(stepabyss, dis = as.double(dis), n = as.integer(n),
              toolong = as.double(toolong), val = integer(n),
              NAOK = TRUE)$val
    if (trace) {
        cat("Connectivity of distance matrix with threshold dissimilarity",
            toolong,"\n")
        n <- length(unique(out))
        if (n == 1)
            cat("Data are connected\n")
        else {
            cat("Data are disconnected:", n, "groups\n")
            print(table(out, dnn="Groups sizes"))
        }
    }
    out
}

Try the vegan package in your browser

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

vegan documentation built on Sept. 11, 2024, 7:57 p.m.