[R-sig-eco] different symbols to NMDS graph: it works PARTIALLY!??!?

Jari Oksanen jari.oksanen at oulu.fi
Thu Jan 13 10:51:42 CET 2011


On 13/01/11 11:03 AM, "cristabel.duran at waldbau.uni-freiburg.de"
<cristabel.duran at waldbau.uni-freiburg.de> wrote:

> Hola Marcelino,
> 
> I did now what you suggested,
> the lengths of dim(ScoresNMDS) [1] and
> length(pos$for_pos_anl) are the same.
> and all the three categories exits in the vector...
> I still do not find the solution for the problem.
> 
Cristabel,

Do not argue with computers: you'll lose. If the computer doesn't find an
item, it doesn't exist. Computers are more pedantic than we humans, and they
are correct. It may happen, for instance, that the name of your item is
"forest " (note the blank), and then there is no "forest" (note the missing
blank). It is rather easy to see what you get with

ScoresNMDS[pos$for_pos_anl=="forest",]

If those three cases you listed in your message are the only things that you
should display, the following (or a variant of this) should work if 'metaf'
is a metaMDS() result, and pos$for_pos_anl is a factor where levels are
ordered as c("border", "gap", "forest"):
 
plot(metaf,type="none",choices = c(1,3))
## must be a factor
indx <- as.numeric(pos$for_pos_anl)
points(metaf,
display="sites",choices = c(1,3),
  pch=c(16,17,4)[indx], cex=0.8,

  col=c("green", "black", "red")[indx] )
## these use internal ordering of levels: check
legend("topleft", levels(pos$for_pos_ani), pch=c(16,17,4), col =
c("green","black", "red"))

All this is completely unchecked, and probably your factor levels are in
different order and you must change the arguments correspondingly.

Cheers, Jari Oksanen

Cheers, jari Oksanen



More information about the R-sig-ecology mailing list