Search code examples
rvegan

Error message when using Specpool in Vegan Package


I'm trying to calculate species richness and chao for a list of sites. However I keep getting this error message:

Error in if (a2 > 0) var.chao[is] <- a1 * ssc * (0.5 + ssc * (1 + aa/4) *  : missing value where TRUE/FALSE needed

I'm not completely sure what the error message is trying to imply. Specpool works with the same dataset when trying to find the values of an country (for example) just not when I use the sites category.

I can put up dataset if needed.

Anyone got any ideas?


Solution

  • 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).