R/spenvcor.R

"spenvcor" <-
function (object) 
{
    if (is.null(object$CCA))
        stop("Needs results from constrained ordination")
    u <- object$CCA$u
    wa <- object$CCA$wa
    if (!inherits(object, "rda")) { # is CCA
        r <- sqrt(object$rowsum)
        u <- sweep(u, 1, r, "*")
        wa <- sweep(wa, 1, r, "*")
    }
    diag(cor(u, wa))
}

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.