Re: [R] metaMDS and envfit: Help reading output

From: Songer, Katherine B - DNR <>
Date: Mon, 16 May 2011 14:59:23 -0500


Thanks very much! That thread was especially helpful.


P Katie Songer
Water Resources Management Specialist
Wisconsin Department of Natural Resources
(*) phone: (608)264-8947
(*) e-mail:

From: Scott Chamberlain [] Sent: Tuesday, May 10, 2011 05:56 PM
To: Songer, Katherine B - DNR
Subject: Re: [R] metaMDS and envfit: Help reading output

Here is a thread I found on this issue: It's not a simple correlation apparently, but I can't figure out how they get the output from envfit using lm(Y ~ scores1 + scores2).

You can plot the data like:
library(MASS); require(vegan)
ord <- metaMDS(varespec)
fit <- envfit(ord, varechem)

On Tuesday, May 10, 2011 at 3:51 PM, Songer, Katherine B - DNR wrote:

Hello R experts,

I've used metaMDS to run NMDS on some fish abundance data, and am also working on correlating environmental data to the NMDS coordinates. I'm fairly new to metaMDS and NMDS in general, so I have what are probably some very basic questions. My fish abundance data consists of 66 sites for which up to 20 species of fish were identified and counted. I ran metaMDS on this data in 3 dimensions (after using a scree plot to check for stress levels in the different dimensions). I then used envfit to correlate a predictor dataset of environmental variables with the NMDS results, using the following code.

Fish<"Fish.csv",header=TRUE, sep = ",")) Fish.mds<-metaMDS(Fish,zerodist = "add",k=3,trymax=20)

Predictors<"Predictors.csv",header=TRUE, sep = ",")) <- envfit(Fish.mds$points, Predictors, k=3, 1000, na.rm = TRUE)

The output of was as follows (table truncated):

Dim1 Dim2 r2 Pr(>r)
DrainArea -0.5923233 -0.8057004 0.7674 0.000999 *** Flow -0.5283236 -0.8490431 0.7847 0.000999 *** StrmWidth -0.6993457 -0.7147836 0.6759 0.000999 *** Gradient 0.4541225 0.8909392 0.2085 0.010989 *

I'd like to better understaand how to read this table. I understand that Dim1 and Dim2 refer to the dimensions of the vectors produced by envfit, and r2 is the r-squared of those vectors. But how do I visualize these vectors in a 3-d plot? To which of the 3 NMDS dimensions are these vectors being correlated? Is there code to produce the x, y, and z coordinates of each of the sites in Fish.mds?

Thanks very much.

[[alternative HTML version deleted]]<> mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code.

        [[alternative HTML version deleted]] mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Mon 16 May 2011 - 20:02:13 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 16 May 2011 - 20:20:07 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive