R/distconnected.R

"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, PACKAGE = "vegan")$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 May 2, 2019, 5:51 p.m.