[R] Customizing ordination plots using symbols for factors
Jari Oksanen
jari.oksanen at oulu.fi
Wed Apr 7 11:15:45 CEST 2010
Sarah Berke <skberke <at> gmail.com> writes:
r (or different shape or whatever).
>
> I was sure that this would be easy to figure out. But I have been
> scouring help files and R tutorials for 2 days, and I am at my wits
> end! If my points and my factors were in a single dataframe then I
> would know how to do it, but I don't see how to make the matrix with
> the factors talk to the ordination result (which is typeof=list). I
> assume that with() must be involved, but how? I suspect that I've
> actually read the relevant help files, but did not recognize the
> answer as such. All of the vegan documentation I've found seems to
> assume that this is so basic that anyone could figure it out on their
> own.
Sarah,
You can extract specificy types of scores from the list type result using
function scores() which returns a matrix of scores:
scores(comm.mds, display="sp")
You can use function points() to directly add a specific set of points to an
ordination graph. The following example first draws an empty plot (with only
frames and axes), and then adds species scores as points of different colours
and symbols:
plot(comm.mds, type = "n")
points(comm.mds, dis="sp", pch = as.numeric(FD.mat$feeding), col =
as.numeric(FD.mat$feeding))
This works only with vegan functions, but you seemed to be using them.
Best wishes, Jari Oksanen
More information about the R-help
mailing list