[R-sig-eco] NMDS dot number=site number (vegan)

Gavin Simpson ucfagls at gmail.com
Mon Sep 9 17:52:37 CEST 2013


Read `?text.metaMDS` which has the details of the arguments accepted
by this `text()` method. Specially it has argument `labels` which
allows you to specify the labels used for the "points". The ordering
of the scores (i.e. the rows of the score matrix that gives the
coordinates in ordination space, the coordinates of the pints on the
plot) is as per the ordering in the original data. If `labels` is not
supplied then the `text()` method will use the `rownames()` of the
data matrix.

Because the plotted scores are in data order, it is very simple to
request the site number (i.e. row number) be used for plotting:

    text(NMDS, display = 'sites', labels = seq_len(nrow(dune)))

Or alternatives, set the rownames to something you want, prior to
fitting the MDS

    rownames(dune) <- c("blah","foo","bar", ....)

or in your case

    rownames(dune) <- seq_len(nrow(dune))

then refit your ordination.

HTH

G


On 7 September 2013 07:19, Elaine Kuo <elaine.kuo.tw at gmail.com> wrote:
> Dear list,
>
>
> This is Elaine, a postgraduate studying bird distributions in East Asia.
>
> I would like to ask how to generate NMDS graphs with the dot number
> equal to the site number, using R vegan.
>
> I read the vegan manual and copied the example code metaMDS.
> (The code is as below)
> However, the resulting NMDS graph has the dot number as
> (site number*site number)/2.
>
> Thank you in advance.
>
> Code
> library(MASS)
>   library(vegan)
>   NMDS  <-  metaMDS(dune,k=2, distfun  =  betadiver,  distance  =
>  "sim",trymax=100,zerodist="add")
>   plot(NMDS,  type  =  "n")
>
>   # species as symbols
>   points(NMDS, display = 'species', pch = '+', cex = 0.6)
>
>   # sites as text
>   text(NMDS, display = 'sites')
>
> Elaine
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology



-- 
Gavin Simpson, PhD



More information about the R-sig-ecology mailing list