Cross Validated Asked on December 11, 2021
I have been following the excellent guide: NMDS ordination in R
I wish to use the envfit function to see which of my environmental parameters correlate with community data dissimilarity.
When I run the following (in R),
> comm.envfit <- envfit(comm.MDS, environmental, permutations = 999, na.rm = TRUE)
> comm.envfit
***VECTORS
NMDS1 NMDS2 r2 Pr(>r)
var1 0.92494 -0.38012 0.1236 0.003 **
var2 -0.72824 0.68532 0.3048 0.001 ***
var3 -0.52969 0.84819 0.1810 0.001 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Permutation: free
Number of permutations: 999
Great, but then when I call the scores, the NMDS values change, this is confusing me somewhat:
> env.scores.comm <- as.data.frame(scores(comm.envfit, display = "vectors"))
> env.scores.comm
NMDS1 NMDS2
var1 0.3251857 -0.1336398740
var2 -0.4020263 0.3783353128
var3 -0.2253563 0.3608632546
Also, as a extra point I am confused by the R2 and p values, although I am sure I can figure this out.
The way I understood it is there is scaling going on to try to fill the plot, so that explains the different values that appear under the NMDS1/NMDS2 columns.
Taken from the envfit documentation from the vegan package:
"The lengths of arrows for fitted vectors are automatically adjusted for the physical size of the plot, and the arrow lengths cannot be compared across plots. For similar scaling of arrows, you must explicitly set the arrow.mul argument in the plot command; see ordiArrowMul and ordiArrowTextXY. The results can be accessed with scores.envfit function which returns either the fitted vectors scaled by correlation coefficient or the centroids of the fitted environmental variables."
Answered by fontinalis77 on December 11, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP