[R] help on Nan error

Richard.Cotton at hsl.gov.uk Richard.Cotton at hsl.gov.uk
Fri May 15 10:57:13 CEST 2009


> When i want to do ANOSIM i get an NaN error message. What is wrong?
> > (lots of other code)
> > iwithin=rep(0,(N*(N-1)/2) )
> > r.w=sum(r*iwithin)/sum(iwithin)

iwithin is a vector of zeroes and so is its sum.  r*iwithin is also a 
vector of zeroes, and so is its sum.  Thus r.w=sum(r*iwithin)/sum(iwithin) 
is zero divided by zero, which is not defined.

Regards,
Richie.

Mathematical Sciences Unit
HSL


------------------------------------------------------------------------
ATTENTION:

This message contains privileged and confidential inform...{{dropped:20}}




More information about the R-help mailing list