I'm learning to use the iNEXT package and when I run the code, I get this error:
Error in if (t > sum(y)) { : missing value where TRUE/FALSE needed
Here is a little fragment of my datase:
Localidad n MorfoSp1 MorfoSp2 MorfoSp3 MorfoSp4 MorfoSp6 MorfoSp7 MorfoSp8 MorfoSp9 MorfoSp10 MorfoSp11 MorfoSp12 MorfoSp13 MorfoSp14 MorfoSp15 MorfoSp16 MorfoSp17 MorfoSp18 MorfoSp19 MorfoSp20 MorfoSp21 MorfoSp22 MorfoSp23 MorfoSp24 MorfoSp25 MorfoSp26 MorfoSp27 MorfoSp28 MorfoSp29 MorfoSp30 MorfoSp31 MorfoSp32
Yat1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
Yat1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Yat1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
While using this code
test=as.data.frame(t(Yat))
names(test) <- as.matrix(test[1, ])
test <- test[-1, ]
test[] <- lapply(test, function(x) type.convert(as.character(x)))
test
iNEXT(test, q=1, datatype = "incidence_freq")
read.table(Yat, header = T, as.is = F)
What could bring this error and how can I fix it or if the error is within the data.