-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Species accumulation curves ("exact") with a single inventoried species: confusion between sites and richness? #501
Comments
Confirmed. There are numerous reproducible ways of getting this: ## only one non-zero species
x <- matrix(0, 1000, 1000) # matrix of zeros
x[c(125, 618), 413] <- 1 # add two occurrences for species 413, still 999998 zeros
specaccum(x)
## take only one species from a data set
specaccum(dune[,2])
## one sampling unit should be OK with the message
specaccum(dune[2,]) I think this happens because of an implicit assumption that a vector (column or row) can only come from a single sampling unit. I don't remember why I assumed so: the function was released in 2003 (vegan 1.6-0) with this assumption which pre-dates using version control systems. Similar assumption was made in diversity indices as well, and it may just been carried over here without much thinking. I'll see what to do. |
If some sampling units have zero species, accumulated richness can be < 1. This happens with one-species communities of issue #501.
The branch There is a thin possibility that this breaks some other package that expected the old behaviour. I don't expect so, but better check before merging. |
Dear @jarioksa |
Try with the reproducible examples in my earlier messages. They work with me. If they don't work with me, you probably did not use the updated function from the github. |
@jarioksa, I had accidentally forgotten to detach the vegan package from R., so it was the old function that was running... I'm really sorry for the inconvenience. Thank you very much for your help and for your reactivity and availability !!! |
Fixed with 6a5f9b3 |
Dear all,
I’ve just started using the “specaccum” function with the “exact” method to plot species accumulation curve, so I apologize in advance if my following comment is due to my unfamiliarity with this method.
I want to make species accumulation curves for several forests that I have inventoried with 8 quadrats.
In one of these forests, I recorded only one species, which is present in three of the eight quadrats.
However, when I use the "specaccum" function for this forest as follows:
specaccum(data,method="exact")
I get the following result and error message:
The "data" object is a matrix with the quadrats (sites) as rownames and the species names as colnames.
<style> </style>Therefore, I don't understand why the error message says that only one site is provided, nor why the richness is three. There seems to be a kind of inversion between sites and richness, while the community matrix seems correct.
Thank you for your attention to this matter,
Léa
The text was updated successfully, but these errors were encountered: