Leonard Sandin
2006-Oct-21 11:19 UTC
[R] Problems running IsoMDS using vegdist with pres-abs data and two sites with zero distance
Hi I have just (finally) started to poke around in R and wanted to analyse a stream fish dataset with 28 sites and 18 species. When trying to follow the Vegan manual to run nmds from distance measures calculated by the vegdist function it turns out that I have two sites (streams) with the exactly the same four species (I have used pres-abs data in this case). When I try to run isoMDS I get an error message saying that: Error in isoMDS(vare.dis) : zero or negative distance between objects 14 and 15 i.e. the two sites with the same fish species. I can run the decorana function with "sensible" results so the dataset seems to be ok. My next step would be to compare the results of the fish ordination with some other datasets from the same sites (i.e. through procrustes rotation) - so I wouldn?t like to remove one of the "twin" sites. Any suggestion on how to circumvent this or am I simply using the wrong method? Best wishes, Leonard -- Dr. Leonard Sandin Department of Environmental Assessment / Milj?analys Swedish University of Agricultural Sciences / SLU P.O. Box 7050 SE-750 07 Uppsala Sweden Work phone +46-(0)18-673813 fax +46-(0)18-673156 http://www.ma.slu.se --
Gavin Simpson
2006-Oct-21 11:49 UTC
[R] Problems running IsoMDS using vegdist with pres-abs data and two sites with zero distance
On Sat, 2006-10-21 at 13:19 +0200, Leonard Sandin wrote:> Hi > I have just (finally) started to poke around in R and wanted to analyse > a stream fish dataset with 28 sites and 18 species. When trying to > follow the Vegan manual to run nmds from distance measures calculated by > the vegdist function it turns out that I have two sites (streams) with > the exactly the same four species (I have used pres-abs data in this > case). When I try to run isoMDS I get an error message saying that: > Error in isoMDS(vare.dis) : zero or negative distance between objects 14 > and 15 > i.e. the two sites with the same fish species. I can run the decorana > function with "sensible" results so the dataset seems to be ok. > My next step would be to compare the results of the fish ordination with > some other datasets from the same sites (i.e. through procrustes > rotation) - so I wouldn?t like to remove one of the "twin" sites. > Any suggestion on how to circumvent this or am I simply using the wrong > method? > > Best wishes, Leonard >Hi Leonard, I assume you are running isoMDS (package MASS) directly? If so, take a look at metaMDS function in vegan which has an argument zerodist which if you set it to "add" adds a small distance so you don't get this error. HTH G -- %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% Gavin Simpson [t] +44 (0)20 7679 0522 ECRC & ENSIS, 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/cv/ London, UK. WC1E 6BT. [w] http://www.ucl.ac.uk/~ucfagls/ %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%