JohnsonHsieh / iNEXT

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

Error in yi[i]:(nT - 1) : NA/NaN Argument #75

Open RichTob opened 1 year ago

RichTob commented 1 year ago

Hello,

When running the iNEXT function, I get this error:

Error in yi[i]:(nT - 1) : NA/NaN Argument

I have data of type incidence_raw that includes following matrix which is the source for the error:

$B [,1] [,2] [,3] [,4] a 0 0 1 0 b 1 1 0 1 c 1 0 0 0

com_list.zip

Others also experienced this error: https://stackoverflow.com/questions/75364851/incidence-raw-data-structure-for-inext-package-error-error-in-yiint-1

Can you provide a solution to this?

EDIT: I installed version 2.2.20. Now it works but i get the error message:

1: In EstiBootComm.Sam(c(nT, y)) : This site has only one species. Estimation is not robust.

Best Tobi

anairori commented 1 year ago

Hi Tobi!

Thanks for sharing how you solved it, it helped me as well, and I used the R version 3.6.3 and iNEXT version 2.0.20; it seems like there is a bug under newer versions of the package.

Good luck, Ori.

markschl commented 1 year ago

I ran into the same problem and can confirm that version 2.0.20 does not result in a hard error, while 3.0.0 does (only the mentioned warning in the case of very few species).

In my case, the error usually occurs with incidence matrices of 2-4 columns (sites) and a total richness (rows) of up to 15.

Matrices with more rows usually work, and the value for qD is virtually the same in version 2.0.20 and 3.0.0 (size based estimation); values differ by < 5e-4.

icrichmond commented 1 year ago

I am running into this issue as well. Installing the earlier version works for the iNEXT function but then I run into an old issue when trying to use estimateD with the older version... I seem to be stuck in a loop? If I want to use the iNEXT function I need the 2.0.20 version, but then if I want to estimate diversities from that using estimateD function, I need the 3.0.0 version.

Any ideas on how to get around this?

JELLY1 commented 2 days ago

I know it's been over a year but I'm running into this problem now and i wanted to see if anyone has found a solution? I'm running 3.0.1.