Open mhepner90 opened 7 years ago
Hi mhepner90
@JohnsonHsieh thank you for responding. I tried as an "as.data.frame" but still received the same error. All of my 7 sites have more then one observed species. Any other thoughts?
Here is my code (https://github.com/mhepner90/RVC/blob/master/iNEXT.Rmd) I'd appreciate if you can take a look and try and fix my error.
Show me a screenshot by using View(spec_by_strata)
, thx.
I sent you an email euler96@gmail.com with a csv file because I have over 300 species, you would not be able to see entire dataset with View.
Hi
Seeing similar error here. Were you able to solve this?
Best, Lars
I'm getting the same warning as @mhepner90 reports.
I'm seeing this error both on the latest CRAN version (2.0.12) and the github version (2.0.14).
Any idea why this happens?
Best Lars
library(iNEXT)
inext_input <- data.frame("site_1" = c(1,18,1,13,0,1,2,0,7,3),
"site_2" = c(0,0,0,0,3,0,0,1,0,3),
row.names = paste("sp", 1:10, sep = "_"))
iNEXT(inext_input,
q = 0,
datatype = "abundance",
endpoint = NULL,
se = TRUE,
conf = 0.95) -> inext_output
#> Warning in EstiBootComm.Ind(Spec): This site has only one species.
#> Estimation is not robust.
#> Warning in BootstrapFun.abun(x = x, FunName, datatype, B): This site has
#> only one species. Estimation is not robust.
#> Warning in BootstrapFun.abun(x = x, FunName, datatype, B): This site has
#> only one species. Estimation is not robust.
# Verify that all sites have more than one species
inext_input[inext_input > 0] <- 1
colSums(inext_input)
#> site_1 site_2
#> 8 3
There seems to be some overlapping issues about warning messages (I've just posted to the newest #31 - sorry. I provided this internal spider
example. The warnings seem to be linked to the presence or absence of at least one species with an abundance of 1.
library(iNEXT)
# data
data(spider)
# create 7 vectors with various 1 and 0 entries
spiderG1 <- spider$Girdled # OK
spiderG2 <- spider$Girdled[spider$Girdled>1] # Incorrect Warning
spiderG3 <- c(spider$Girdled[spider$Girdled>1],1,1) # OK
spiderG4 <- c(spider$Girdled[spider$Girdled>1],1) # OK
spiderG5 <- c(spider$Girdled[spider$Girdled>1],1,0) # Oddly OK
spiderG6 <- c(spider$Girdled[spider$Girdled>1],0) # Incorrect Warning
spiderG7 <- c(spider$Girdled[spider$Girdled>1],0,0) # Incorrect Warning
# run iNEXT
iNEXT(spiderG1)
iNEXT(spiderG2)
iNEXT(spiderG3)
iNEXT(spiderG4)
iNEXT(spiderG5)
iNEXT(spiderG6)
iNEXT(spiderG7)
Hi there, I am also getting the same warning. I made sure that I removed the column that had the names of the species, then made a new data set with these as the row names. I also made sure that the structure of my data frame was the same as that for the bird data set. When I run iNEXT on bird I don't get an error. Can you please tell me what is going wrong. Thanks Belinda
d<-read.table (file ="iNEXT_2014-2016.csv", header=TRUE,sep=",") list(d) [[1]] X Y.2014 Y.2015 Y.2016 1 Atherinidae 8 3 12 2 Caringidae 9 102 11 3 Chirocentridae 0 19 0 4 Clupeidae 15 138 218 5 Engraulidae 538 2056 3660 6 Exocoetidae 6 11 7 7 Hemiramphidae 1 4 0 8 Mollusca 1 11 12 9 Mugilidae 0 1 0 10 Scombridae 0 0 1 11 Terapontidae 0 44 0 12 Tetraodontidae 0 1 0
d2<-d[,-1] rownames(d2)<-d[,1] out1 <- iNEXT(d2, q=0, datatype="abundance") Warning messages: 1: In EstiBootComm.Ind(Spec) : This site has only one species. Estimation is not robust. 2: In BootstrapFun.abun(x = x, FunName, datatype, B) : This site has only one species. Estimation is not robust. 3: In BootstrapFun.abun(x = x, FunName, datatype, B) : This site has only one species. Estimation is not robust. str(d2) 'data.frame': 12 obs. of 3 variables: $ Y.2014: int 8 9 0 15 538 6 1 1 0 0 ... $ Y.2015: int 3 102 19 138 2056 11 4 11 1 0 ... $ Y.2016: int 12 11 0 218 3660 7 0 12 0 1 ... str(bird) 'data.frame': 41 obs. of 2 variables: $ North.site: int 0 0 41 0 3 1 5 4 4 11 ... $ South.site: int 3 18 31 2 1 2 5 1 6 32 ...
just saw it was solved in #31
@JohnsonHsieh I am a graduate student at USF studying reef fish biodiversity in the FL keys. I have computed richness, shannon, and simpson using the VEGAN package but am having trouble computing the same indices with your iNEXT package. I keep getting a returned error saying my sites have only one species when in there are many.
"iNEXT.Rmd" code
7 stratas by 348 species
str(spec_by_strata) 'data.frame': 348 obs. of 7 variables: $ FDLR: Factor w/ 147 levels " 0"," 0",..: 4 40 47 86 49 35 101 93 87 86 ... ..- attr(, "names")= chr "ABU SAXA" "ACA ASPE" "ACA BAHI" "ACA CHAP" ... $ FMLR: Factor w/ 182 levels " 0"," 0"," 20",..: 31 20 121 160 92 104 12 85 178 44 ... ..- attr(, "names")= chr "ABU SAXA" "ACA ASPE" "ACA BAHI" "ACA CHAP" ... $ FSLR: Factor w/ 141 levels " 0"," 10",..: 92 120 104 93 62 91 18 28 106 93 ... ..- attr(, "names")= chr "ABU SAXA" "ACA ASPE" "ACA BAHI" "ACA CHAP" ... $ HRRF: Factor w/ 158 levels " 0"," 0",..: 139 57 77 64 30 97 11 76 111 64 ... ..- attr(, "names")= chr "ABU SAXA" "ACA ASPE" "ACA BAHI" "ACA CHAP" ... $ INPR: Factor w/ 111 levels " 6"," 0",..: 48 56 28 85 45 53 36 36 36 85 ... ..- attr(, "names")= chr "ABU SAXA" "ACA ASPE" "ACA BAHI" "ACA CHAP" ... $ MCPR: Factor w/ 145 levels " 0"," 28",..: 71 116 64 81 46 70 22 22 96 81 ... ..- attr(, "names")= chr "ABU SAXA" "ACA ASPE" "ACA BAHI" "ACA CHAP" ... $ OFPR: Factor w/ 136 levels " 0"," 2",..: 55 57 78 94 43 74 57 17 107 94 ... ..- attr(*, "names")= chr "ABU SAXA" "ACA ASPE" "ACA BAHI" "ACA CHAP" ... spec_by_strata FDLR FMLR FSLR HRRF INPR MCPR OFPR ABU SAXA 102 6340 9924 43312 1542 6272 3606 ACA ASPE 2 4 20 8 2 22 4 ACA BAHI 2476 31736 13690 12130 580 5306 6256 ACA CHAP 0 6 0 0 0 0 0 ACA CHIR 2610 19988 4940 3368 1308 2452 2728 ACA COER 1666 24444 9380 15520 1792 6252 5796 ACA MARI 14 2 0 0 0 0 4 ACA POLY 12 18 2 12 0 0 0 ACA QUAD 10 92 14 20 0 14 14 ACA SOLA 0 0 0 0 0 0 0 ACA SPIN 0 0 0 0 0 0 0 iNEXT(spec_by_strata, q = 0, datatype = "abundance") Error in FUN(newX[, i], ...) : invalid data structure In addition: Warning messages: 1: In EstiBootComm.Ind(Spec) : This site has only one species. Estimation is not robust. 2: In EstiBootComm.Ind(Spec) : This site has only one species. Estimation is not robust. 3: In EstiBootComm.Ind(Spec) : This site has only one species. Estimation is not robust. 4: In EstiBootComm.Ind(Spec) : This site has only one species. Estimation is not robust. 5: In EstiBootComm.Ind(Spec) : This site has only one species. Estimation is not robust. 6: In EstiBootComm.Ind(Spec) : This site has only one species. Estimation is not robust. 7: In EstiBootComm.Ind(Spec) : This site has only one species. Estimation is not robust. @JohnsonHsieh why am I getting this error when I have several species per community?