I am trying to produce rarefied species accumulation curves for two different habitat types using the rarefaction method in specaccum function of the vegan package using the code:
spa <- specaccum(Example, method = "rarefaction")
The function works for one data set but not the other where it produces this error:
Error in rarefy(t(freq), ind[i], se = TRUE) :
function accepts only integers (counts)
However, the data is laid out exactly the same as the other data set and when I investigate the data frame it says that all the data for the species is in integer form.
Here is a much smaller section of the data frame:
Site AA AB AC AD AE AF AG AH AI AJ AK AL
1.1 0 0 0 0 1 0 0 2 0 0 0 0
1.2 1 0 0 0 0 0 0 0 0 0 0 0
1.3 0 0 1 0 0 0 0 0 0 0 0 0
2.1 1 0 0 0 1 0 0 0 0 0 0 0
2.2 0 1 0 0 0 0 0 0 0 0 0 0
2.3 0 0 0 0 0 0 0 1 0 0 1 1
3.2 0 2 1 0 1 0 0 0 0 0 0 0
3.3 0 0 0 0 2 0 0 3 0 0 0 0
4.1 0 0 0 0 0 0 1 1 0 0 0 0
4.2 0 0 0 0 0 0 0 0 0 0 0 0
4.3 0 0 0 0 1 0 0 1 0 0 0 0
5.1 0 1 0 0 0 1 0 3 0 0 0 0
5.2 0 0 1 0 2 0 0 1 0 0 0 0
5.3 0 0 0 1 3 2 0 4 0 0 0 0
6.1 0 0 0 0 0 0 0 0 0 0 0 0
6.2 0 2 2 0 0 2 0 0 0 0 0 0
6.3 0 0 0 0 0 0 0 0 0 0 0 0
Sites being sampling points within the habitat site, letters denoting species. I am unsure as to why it is working for one set of data but not the other when they are both laid out like this. Can someone help me understand?
Thanks