R/anova.betadisper.R

`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 2 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 May 2, 2019, 5:51 p.m.