Details
Analysis of similarities (ANOSIM) provides a way to test statistically whether there is a significant difference between two or more groups of sampling units. Function anosim operates directly on a dissimilarity matrix. A suitable dissimilarity matrix is produced by functions dist or vegdist. The method is philosophically allied with NMDS ordination (isoMDS), in that it uses only the rank order of dissimilarity values.
If two groups of sampling units are really different in their species composition, then compositional dissimilarities between the groups ought to be greater than those within the groups. The anosim statistic R is based on the difference of mean ranks between groups (r_B) and within groups (r_W):
Note
I don't quite trust this method. Somebody should study its performance carefully. The function returns a lot of information to ease further scrutiny. Most anosim models could be analysed with adonis which seems to be a more robust alternative.