JohnsonHsieh / iNEXT

R package for interpolation and extrapolation
https://JohnsonHsieh.github.com/iNEXT
57 stars 26 forks source link

Shannon diversity from function ChaoShannon doesn't match iNEXT values #64

Open jivelasquezt opened 3 years ago

jivelasquezt commented 3 years ago

Hi there,

The following line returns an observed shannon diversity of 12.06 for girdled treatment in the spider dataset : iNEXT(spider, q=0, datatype="abundance").

Which doesn't match the observed shannon diversity of 2.49 returned when running ChaoShannon(spider$Girdled, datatype="abundance")

Doing it by hand, the correct shannon diversity for girdled is 2.49. Where does the 12.06 value of iNEXT come from?

p<-spider$Girdled/sum(spider$Girdled) -sum(p*log(p))

Thanks!