[R-sig-eco] nested.npmanova -- distance matrices as input?

Jari Oksanen jari.oksanen at oulu.fi
Mon Mar 11 08:57:54 CET 2013


Erin,

R is open source: you can see the source code if in doubt. 

Looking at the source code, the situation is a bit unclear and depends on the details of your data that I don't know. It seems that nested.npmanova() accepst R distances structures of class "dist". If your Unifrac distances inherit from "dist" class, nested.npmanova(), they will be handled correctly in nested.npmanova. If they are, like your write, "distance matrices", then they will be handled incorrectly: they are accepted silently but treated like they were raw data matrices. You should get an error message from vegdist() in that case, as it knows no method = FALSE, so it may be that your dissimilarities were correctly handled. However, we don't know as we even do not know what software (R package, external software) you used in calculating unifrac dissimilarities. 

If 'd' are your distances, see what does class(d) say. If says "dist" (possibly with some other alternatives), you are safe. If your 'd' are not of class "dist", you can try if as.dist(d) changes them to "dist".

Cheers, Jari Oksanen
________________________________________
From: r-sig-ecology-bounces at r-project.org [r-sig-ecology-bounces at r-project.org] on behalf of Erin Nuccio [enuccio at gmail.com]
Sent: 11 March 2013 07:08
To: r-sig-ecology at r-project.org
Subject: [R-sig-eco] nested.npmanova -- distance matrices as input?

Hello list,

Does anyone know nested.npmanova can take distance matrices as input?   When I read the helpfile, it specifies that the input for nested.npmanova is a data frame, and sounds like distance matrices can only be used for nested.anova.dbrda (see below).  However, if I try inputting a Unifrac distance matrix, and make method = FALSE, it completes without any errors.  Did this complete correctly?

"formula    Formula with a community data frame (with sites as rows, species as columns and species abundance as cell values) or (for nested.anova.dbrda only) distance matrix on the left-hand side and two categorical variables on the right-hand side (with the second variable assumed to be nested within the first)."

Thank you,
Erin
_______________________________________________
R-sig-ecology mailing list
R-sig-ecology at r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology



More information about the R-sig-ecology mailing list