R/anova.betadisper.R

Defines functions `anova.betadisper`

`anova.betadisper` <- function(object, ...)
{
    model.dat <- with(object, data.frame(Distances = distances,
                                         Groups = group))
    n.grps <- with(model.dat, length(unique(as.numeric(Groups))))
    if(n.grps < 2)
        stop("anova() only applicable to two or more groups")
    anova(lm(Distances ~ Groups, data = model.dat))
}

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.