[R] label plotting on nmds diagram
Antonio Olinto
aolinto_r at bignet.com.br
Wed Nov 14 19:19:52 CET 2007
Hi Gavin, thanks for your message.
You are right. The function nmds is from library labdsv and not from vegan. My
mistake.
Well, that's what I did:
library(vegan)
library(labdsv)
nms.euc <- nmds(dis.euc,4)
initial value 13.457832
iter 5 value 8.589716
iter 10 value 7.989993
iter 15 value 7.734503
iter 20 value 7.539719
iter 25 value 7.438721
final value 7.397254
converged
plot(nms.euc)
text(nms.euc$points[,1],nms.euc$points[,2],labels=row.names(nms.euc$points),pos=4,cex=0.7)
# got overwritten labels
identify(plot(nms.euc))
numeric(0)
It seems that ordiplot is not suitable to nmds but only to cca and rda.
But you understood exactly what I want. Your example showed for cca what I want
for nmds plot.
Best regards,
Antonio
Citando Gavin Simpson <gavin.simpson em ucl.ac.uk>:
> On Wed, 2007-11-14 at 11:22 -0300, Antonio Olinto wrote:
> > Hi,
> >
> > I'm using nmds command (library vegan) to analyze some fishing data.
>
> I doubt it - there is no nmds command. Do you mean metaMDS() ? This uses
> isoMDS() from package MASS with some extra features.
>
> >
> > I'd like to plot not only points, but also the names of species and
> stations in
> > a specified position.
> >
> > I used the command
> > text(nmds$points[,1], nmds $points[,2],labels=row.names(nmds
> > $points),pos=3,cex=0.5)
> >
> > But the labels are sometimes overlapped.
> >
> > Is there any way to use identify, or a similar command, to plot the row
> names in
> > a given position? Identify would be perfect but it indicates the row number
> and
> > I'd like to have the row name given in nmds$points.
>
> Have a look at ?orditorp in vegan for an alternative approach, but yes
> you can use identify, but you have to capture the output of the plot
> call and use that in your identify call:
>
> require(vegan)
> data(varespec)
> mod <- cca(varespec)
> mod.plt <- plot(mod, display = "species", type = "p")
> identify(mod.plt)
>
> See ?identify.ordiplot for more info.
>
> HTH
>
> >
> > Many thanks,
> >
> > Antonio Olinto
> > Sao Paulo Fisheries Institute
> > Brasil
> >
> >
> >
> >
> >
> >
> > -------------------------------------------------
> > BCMG Internet Webmail
> > www.bcmg.com.br
> >
> > ______________________________________________
> > R-help em r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> --
> %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
> Dr. Gavin Simpson [t] +44 (0)20 7679 0522
> ECRC, UCL Geography, [f] +44 (0)20 7679 0565
> Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk
> Gower Street, London [w] http://www.ucl.ac.uk/~ucfagls/
> UK. WC1E 6BT. [w] http://www.freshwaters.org.uk
> %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
>
>
-------------------------------------------------
BCMG Internet Webmail
www.bcmg.com.br
More information about the R-help
mailing list