I am trying to make an nMDS plot of data with a nested factor. I would like the nMDS to show both factors on one plot by using symbols and colour.
In this reproducible example, if use
was nested in moisture
, I would like the plot to show Moisture
as different symbols, and then Use
as different colours.
So far I have figured out this:
library("vegan")
library("BiodiversityR")
data(dune, dune.env)
MDS <- metaMDS(dune, distance="bray", strata=dune.env$Moisture)
MDS
plot(MDS$points[,2], MDS$points[,1], type="n", main="Communities by Use",
xlab="NMDS Axis 1", ylab="NMDS Axis 2", xlim=c(-1.5,1.5), ylim=c(-1.5,1.5))
ordisymbol(MDS, dune.env, factor="Use", cex=1.25, rainbow=T, legend=T)
Which gives me the different uses as both different symbols and colours, but shows me nothing about moisture. Is it possible to make it show the different factors instead? I'm assuming it might be somewhere in the MDS$points[,]
arguments but I'm not sure what exactly those are doing.