I am trying to use iNEXT R package to calculate Hill numbers and rarefaction curves. Due to the nature of my data, my abundance counts aren't always integers.
When I run iNEXT, it keeps rounding the frequency counts to integers and it messes with the rarefaction curve. The curve will peak during rarefaction, then drop to reach the observed value, the spike again during extrapolation.
How can I stop it from rounding?
Here is the data:
dput(A_mat)
structure(c(7, 17.5, 28, 0, 5, 14.5, 0, 12.5, 9.5, 23.5, 4.5,
2, 20.5, 0, 9, 0, 0, 18.5, 4.5, 2, 2, 0, 0, 0.5, 0, 6, 1, 0,
3.5, 2, 7, 10.5, 6.5, 0.5, 3.5, 0, 0, 5, 0, 9.5, 0, 6, 8, 6.5,
0, 6.5, 22, 2, 1, 7, 0, 4.5, 4, 0.5, 11.5, 13.5, 0, 0, 1.5, 3.5,
2, 0, 0.5, 3, 0.5, 0, 9.5, 0, 0, 8, 1.5, 3.5, 2.5, 0.5, 11, 5.5,
9, 7.5, 0.5, 0, 4, 2.5, 10, 0.5, 0, 1, 0, 3, 4.5, 1, 0, 0, 3.5,
21.5, 3, 12.5, 0.5, 7, 0.5, 6.5, 16, 0, 5.5, 5.5, 0.5, 6, 0,
0, 2.5, 0.5, 1.5, 0, 7, 0, 0, 13.5, 16, 0, 19.5, 0, 2.5, 0, 6,
4, 2.5, 1.5, 2, 2.5, 3.5, 8.5, 13, 0, 12, 0, 0, 0.5, 0, 1), dim = c(23L,
6L), dimnames = list(NULL, c("Sample A1", "Sample A2", "Sample A3",
"Sample A4", "Sample A5", "Sample A6")))
Here is what causes the error. This is only a snippet, but it keeps going for a while.
Code:
A_out<- iNEXT(A_mat, q=c(0,1,2), datatype= "abundance", se=TRUE, knots=40, conf=0.95, nboot=50)
Error:
Warning: 'k' (177.50) must be integer, rounded to 178Warning: 'k' (179.50) must be integer, rounded to 180Warning: 'k' (175.50) must be integer, rounded to 176Warning: 'k' (179.50) must be integer, rounded to 180Warning: 'k' (174.50) must be integer, rounded to 174Warning: 'k' (179.50) must be integer, rounded to 180Warning: 'k' (172.50) must be integer, rounded to 172Warning: 'k' (179.50) must be integer, rounded to 180