[R] In vegan package: running adonis (or similar) on a distance matrix

Jari Oksanen jari.oksanen at oulu.fi
Fri Oct 12 10:09:10 CEST 2012


Roey Angel <angel <at> mpi-marburg.mpg.de> writes:

> 
> Hi,
> Using Vegan package I was wondering if there's a way to use a distance 
> matrix as an input for adonis (or any of the other similar hypothesis 
> testing functions) instead of the usual species by sample table.
> Working in the field of microbial ecology, what I'm trying to do is to 
> overcome the problem of having to use discrete units such as species or 
> OTUs, which are problematic in microbial ecology (if not outright 
> theoretically false).
> What I have instead is a phylometric distance matrix between all my 
> samples based on a phylogenetic tree.
> 
Dear Roye Angel,

According to the documentation, this can be done. See description of the first
argument ('formula') in ?adonis. Your distances (dissmilarities) must be in
standard R form and inherit from class "dist". If they are in some other form,
you should change them to "dist" class. This may succeed with command as.dist().

Cheers, Jari Oksanen




More information about the R-help mailing list