AnneChao / miNEXT

Mixed iNEXT
0 stars 6 forks source link

An error occurred when using "nboots" arguments #9

Open zl19990820 opened 11 months ago

zl19990820 commented 11 months ago

Dear Professor Chao: I encountered a minor issue while utilizing miNEXT: I ran the following code: result_inci_crab = Incidence(crab_inci, knots = 20, nboots = 100) I get an error Error in sample.int(length(x), size, replace, prob) : cannot take a sample larger than the population when 'replace = FALSE' we try to set nboots = 0 (default), and it works well. I also tested the code with bird data, and it works well too. I really can't find what's wrong with my data. And What determines the upper limitation of nboots ? The attached file is the data I used. crab_inci.csv Thank you for offering a plethora of user-friendly tools for biodiversity estimation. I anticipate your response. Zhang, Lin

zl19990820 commented 11 months ago

The same error occurred in my abundance data. I think the error occurred in "Abun_CreatBootstrapSample" function because the length of undetec is larger than the size of zero. Because there are lots of f1 and f2. I'm sorry for these non-professional questions because it's very difficult for me to understand the statistical principles background. I don't know how to solve this problem. but I have tried to change the sample size to "size = min(length(undetec2), length(zero2))", and the code works well. (just based on the data structure).