JohnsonHsieh / iNEXT

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

Zero abundance counts in one or more sample sites #48

Open aquadog7900 opened 4 years ago

aquadog7900 commented 4 years ago

Hi there, I am trying to process my data: iNEXT(num24, q=0, datatype = "abundance")

and run into the following error:

Error in if (sum(x) == 0) stop("Zero abundance counts in one or more sample sites") : missing value where TRUE/FALSE needed In addition: Warning message: In Fun(x, q) : NAs introduced by coercion

My data frame has species in the first column, and 10 site columns with abundances. If some species have zero abundances, that shouldn't be a problem, correct? E.g. the "birds" data set has 0 for some species....

KathrynAlta12 commented 4 years ago

Hi, I don't think that having 0 for some species should be a problem (at least I know it is not if you are running it as incidence data). But you could also try just removing the columns that have n zeros for abundances.

Your additional warning message "In Fun(x, q) : NAs introduced by coercion" is because you have the species names listed in the first column. The program is expected a number there and it gets confused when you are giving it a name so it introduces an NA (Basically the computers version of "I don't know what this is").

I think that removing the first column with the names might fix both of your problems because a column of all NAs might be being red as a "Zero abundance counts in one or more sample sites"