[Vegan-commits] Non metric multidimensional scaling
Eleanor Spratt
eleanorspratt at gmail.com
Mon Aug 15 20:41:40 CEST 2011
To All,
I want to use vegan package to plot an ordination for my data. I have
three habitat types and collected 100 different species from these
habitats. My data frame has habitat and species as a columns. The
habitat column could be classes as categorical with three habitat
types named. The species columns are numbers (abundances) representing
the abundance per habitat.
The code I am wanting to use seems to be having some difficulties.
> NMMDS<-read.csv(file.choose(),header=T)
> library(vegan)
> ordination<-NMMDS[,1:101] # select coloumns excl. env variables
> d<-dist(ordination)
> fit<-metaMDS(d,k=2)
Loading required package: MASS
Error in isoMDS(dist, k = k, trace = isotrace) :
zero or negative distance between objects 63 and 65
In addition: Warning message:
package 'MASS' was built under R version 2.13.1
That is the error message- due to this I can't continue. I have
researched what that error message means, but it is not entirely
clear.
I then tried an alternative way, and this had a different error
> NMMDS<-read.csv(file.choose(),header=T)
> library(vegan)
> library (MASS)
> sol<-metaMDS(NMMDS)
Error in if (any(autotransform, noshare > 0, wascores) && any(comm < 0)) { :
missing value where TRUE/FALSE needed
In addition: Warning message:
In Ops.factor(left, right) : < not meaningful for factors
What do you recommend?
Kind Regards
Eleanor
More information about the Vegan-commits
mailing list