Search code examples
rvegan

How to plot more than 2 dimensions in NMDS ordination?


I want to plot more dimensions than 1 & 2 for a NMDS plot. How do I do this?

Example:
#install.packages("vegan")
library(vegan)
set.seed(2)
community_matrix=matrix(
  sample(1:100,300,replace=T),nrow=10,
  dimnames=list(paste("community",1:10,sep=""),paste("sp",1:30,sep="")))

example_NMDS=metaMDS(community_matrix, # Our community-by-species matrix
                     k=3) # Set to 3 dimensions

Example is from https://jonlefcheck.net/2012/10/24/nmds-tutorial-in-r/

I read its possible to plot further dimensions by specifying ,2,3 for example. But it doesnt work

plot(example_NMDS,2,3). Any suggestions? Thanks! :)

Solution

  • You need to provide the argument choices = , see help page :

    plot(example_NMDS,choices=2:3)
    

    enter image description here