[R-sig-eco] error in MetaMDS

Jari Oksanen jari.oksanen at oulu.fi
Sun Jul 21 08:27:03 CEST 2013


On 21/07/2013, at 03:02 AM, Elaine Kuo wrote:

> Hello
> 
> I am trying to run MetaMDS but got the following error based on the code.
> Please kindly indicate the error source and thank you.
> 
> Elaine
> 
> Code
> # Compute the Simpson distance matrices for the dataset (3 hr using 4GB)
>  library(betapart)
>  dist.sim<-beta.pair(dataR, index.family="sor")
>  class(dist.sim)
> 
>  betasim.sim<-dist.sim[["beta.sim"]]
>  class(betasim.sim)
> 
> # NMDS
>  library(vegan)
>  nms <- metaMDS(betasim.sim,trymax=100,zerodist="add",autotransform
> =FALSE,k=2)
> 
> Error
> Error in if (any(autotransform, noshare > 0, wascores) && any(comm < 0)) {
> :
>  missing value where TRUE/FALSE needed

Elaine,

I cannot reproduce this, and there is no information in the message to know what happens.

Do you have missing values in betasim.sim? Are betasim.sim really dissimilarities?

BTW, vegan has Simpson dissimilarity: use betadiver(x, "sim").

Cheers, Jari Oksanen


More information about the R-sig-ecology mailing list