R/scores.betadisper.R

`scores.betadisper` <-
    function(x, display = c("sites", "centroids"),
             choices = c(1,2), ...)
{
    display <- match.arg(display, several.ok = TRUE)
    sol <- list()
    if("sites" %in% display)
        sol$sites <- x$vectors[, choices]
    if("centroids" %in% display) {
        if(is.matrix(x$centroids))
            sol$centroids <- x$centroids[, choices]
        else
            sol$centroids <- x$centroids[choices]
    }
    if (length(sol) == 1)
        sol <- sol[[1]]
    sol
}
pattakosn/Rworkshop documentation built on May 24, 2019, 8:22 p.m.