Error while using rarecurve() in R

1k views Asked by At

I am using vegan::rarecurve on community data.

lac.com.data<-wisconsin(lac.com.data)
rarecurve(lac.com.data)

Unfortunately, I am getting an error and cannot figure out how to fix it.

Error in seq.default(1, tot[i], by = step) : wrong sign in 'by' argument

I tried

 rarecurve(lac.com.data,step=1)

to no avail.

I already generated a tabasco() graph and performed a Wisconsin standardization on the data frame without any problem.

1

There are 1 answers

5
Jari Oksanen On BEST ANSWER

There is no reproducible example. However, your usage is wrong. Function rarecurve needs input data of counts: it samples individuals from each sampling unit (row), and therefore you must have data on individuals. The error is caused by the use of wisconsin(lac.com.data): after that all rowSums(lac.com.data) will be 1, and your data are non-integers. You cannot use rarecurve for wisconsin() transformed data or any other non-integer data. Here the error manifests because the estimated numbers of individuals (rowSums of transformed data which are all 1) are lower than the number of species (>1).

Obviously we need to check input in rarecurve. We assumed that people would know what kind input is needed, but we were wrong.