[R-sig-eco] species score in vegan
Gavin Simpson
gavin.simpson at ucl.ac.uk
Thu Nov 4 09:20:08 CET 2010
On Wed, 2010-11-03 at 21:57 -0400, Soumi Ray wrote:
> Hi,
>
> I am facing a problem with getting the species score while running NMDS in
> vegan. My data structure looks like this:
>
> ,spa,spb,spc,spd,spe,spf,spf,spg
> 1,214.28,470.63,469.38,1109.22,5708.47,0,2973.86,70.51
> 2,118.29,337.1,465.29,887.01,1600.85,0,62.82,12.54
> 3,0,220.87,699.3,1169.4,1454.49,0,73.8,12.28
> .
> .
>
> I am using the code:
>
> nmds<-read.table('book3_vag.csv', header=TRUE, sep=",", row.names=1)
> dis.bray<-vegdist(nmds, method="bray")
> nmds<-metaMDS(dis.bray, k=3, wascores=TRUE)
>
> But the results are noting giving me the species score:
> Call:
> metaMDS(comm = dis.bray, k = 3, wascores = TRUE)
> Nonmetric Multidimensional Scaling using isoMDS (MASS package)
> Data: dis.bray
> Distance: bray
> Dimensions: 3
> Stress: 8.498857
> No convergent solutions - best solution after 20 tries
> Scaling: centring, PC rotation
> Species: scores missing
>
> Could anyone kindly suggest where am I going wrong?
Read ?metaMDS more closesly, especially the information on argument
'comm':
Arguments:
comm: Community data. Alternatively, dissimilarities either as a
‘dist’ structure or as a symmetric square matrix. In the
latter case all other stages are skipped except random starts
and centring and pc rotation of axes.
so 'wascores' is ignored because you provided the distance matrix - we
don't have the information on the species to be able to do anything more
than compute a standard nMDS with random starts and rotation of results.
If you do read ?metaMDs you will note that you can provide the community
data and get metaMDS to compute the distance matrix for you. So, this
nmds.res <- metaMDS(nmds, distance = "bray", k = 3, wascores = TRUE)
## or equivalently as "bray" is the default
nmds.res <- metaMDS(nmds, k = 3, wascores = TRUE)
should get what you want.
(Why do your want to overwrite your species data object with the output
from metaMDS?) For example, here is a reproducible example
data(varespec)
set.seed(123)
res <- metaMDS(vegdist(varespec, "bray"), k = 3, wascores = TRUE)
res
res2 <- metaMDS(varespec, distance = "bray", k = 3, wascores = TRUE)
res2
HTH
G
> Thank you
>
> Soumi
>
> [[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
--
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
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
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
More information about the R-sig-ecology
mailing list