[R-sig-eco] NMDS trajectory plots

Jari Oksanen jari.oksanen at oulu.fi
Thu Nov 3 08:26:38 CET 2011


On Thu, 2011-11-03 at 05:36 +0200, Lien Sim wrote:
> Hi,
> 
> I'd like to find out how to do temporal trajectory plots by site as
> part of
> an NMDS in vegan. I can run an NMDS on my data when the data is
> structured
> by combined site/time codes:
> 
> JInv <- read.csv("JInv.csv", header=T, row.names = NULL)
> 
> library(vegan)
> 
> JInv.NMDS <- metaMDS(JInv, distance="bray")
> JInv.NMDS
> JInv.NMDS$stress
> par(mfrow=c(1,1))
> plot(JInv.NMDS, type="t", main=paste("NMDS/Bray - Stress =",
> round(JInv.NMDS$stress,3)))
> 
> and think this is how to specify 2 variables as factors
> date <- factor(JInv$date)
> site <- factor(JInv$site)
> 
> but am not sure what to do next. How do I add trajectories for each of
> the
> nine sites over time?
> 
Dear Lien Sim,

If your points are already ordered, you can use function ordiarrows() in
vegan (see its documentation). If your point are not ordered, you either
must reorder your data or get a latest version of ordiarrows from
http://vegan.r-forge.r-project.org (I uploaded a new version with an
option to re-order points within groups some minutes ago as revision
1985).

Cheers, Jari Oksanen



More information about the R-sig-ecology mailing list