You had some cases with one sampling unit per class. The specpool
function is based on presence/absence data and numbers of species frequencies in a collection of sampling units. With only one site, you cannot have but frequency = 1, and some of the indices (Chao, 2nd order Jackknife) need the number of doubletons (= number of species occurring in two sampling units). Although the extrapolated richness cannot be estimated from a single sampling unit in specpool
, such cases should be handled smoothly. The github version of vegan now handles those cases, and I have scheduled release of vegan 2.3-3 next week with this fix. The one-sampling-unit cases will now return the non-extrapolated observed number of species with standard error = 0 for all indices.
You seem to have classes with either one or two sampling units. Although extrapolated species richness can be estimated for two sampling units, I would not trust such extrapolations: you need larger collections (and if you read carefully the specpool
documentation and the articles referenced therein, you may see that we do not have much trust in these extrapolations in general).
if (a2 > 0)
. Can you post a minimal working example that gives the error? My guess is thata2 > 0
evaluates to something other than TRUE or FALSE, like NA.