Open thomatostew opened 4 years ago
I am also having the same issue but in my case SimilarityMult(data,"abundance",q=1,nboot=200,"relative") # runs good SimilarityMult(bugs,"abundance",q=0,nboot=200,"relative") # give the same error as above ERROR CODE "Error in rmultinom(1, ni[k], p[, k]) : NA in probability vector
I'm trying to obtain diversity indices/estimators and dissimilarity measures for a community abundance matrix comprised of samples taken from multiple assemblages. Specifically, I'm running Anne Chao's function:
SimilarityMult
(estimating various similarity indices among N communities). Both richness and abundance-based N-community similarity indices are included" --Anne Chao's SpadeR package.I use packages:
ISSUE
My community abundance matrix set-up: 108 species in rows, 144 sites/samples in columns.
I run:
which yields:
ERROR CODE "Error in rmultinom(nboot, sum(X2), p[, 2]) : NA in probability vector
I run:
which yields:
ERROR CODE "Error in rmultinom(1, ni[k], p[, k]) : NA in probability vector
Below I provide the information from which my data matrix can be recreated and used to run problematic code to find sources of error. I share a subset of my data which includes the first 20 rows and first 25 columns.
I run:
Output:
Produce dataframe
Input dataframe 'bugs' into SimilarityMult functions above.
I do not understand why the code fails. What can I do to make the function work properly? Any solution/advice on the matter would be greatly appreciated.
Thank you!