Closed ramiromelinski closed 3 years ago
Sorry to reply so late, but it looks like you were having trouble with reading the raster data. Sometimes reloading the rasters back into memory fixes this problem. Wondering if you came to a solution or not -- please inform us either way. Thanks.
Hi everyone,
I am doing species distribution modeling (SDM) for several species and therefore using different groups of data. I did the SDM for all species using the default parameters of MaxEnt and I was not satisfied with the results, so now I am trying to improve this modeling, using the ENMeval package to parameterize the models for each species.
Some of the data sets are small compared to others. Altogether, I am modeling more than 90 species. Among these, three species with few occurrences (from 9 to 11). Some of these are showing the errors mentioned in the question title. Most do not, which leads me to believe that it may be something related to the size of the samples.
Before running ENMeval, I load the species' occurrences, transform them into
SpatialPointsDataFrame
, and then remove the duplicated occurrence points within a 5km radius. I run a function determining that if the species has more than 20 occurrences, the k-fold argument for cross-validation uses 5 folders, if it has less than 20, 3 folders.set.seed(1234) if(dim(sp@data)[1]<=20){ k.sp=3 } else { k.sp=5 } bg<-randomPoints(var.spi2[[1]],10000) eval <-ENMevaluate(var.spi2, occ=coordinates(sp), bg.coords=bg, RMvalues=seq(0.5,5,0.5), fc=c("L","LQ","LQH","LQP"), method="randomkfold", kfolds=k.sp, parallel=T, rasterPreds=TRUE)
So, at first I thought it was something related to the small number of elements, because it happened for two sets, one with 10 elements, the other with 9. Later I got the exactly same error for a bigger one (n = 19):
** Running ENMevaluate using maxnet v.0.1.2 * Doing random k-fold evaluation groups... Of 4 total cores using 4 Running in parallel... Error in { : task 3 failed - "index larger than maximal 170"`
The second error also occurs for a group with 10 elements:
_ Running ENMevaluate using maxnet v.0.1.2 Doing random k-fold evaluation groups ... Of 4 total colors using 4 Running in parallel ... Error in file (fn, "rb"): unable to open the connection In addition: There were 21 warnings (use warnings () to see them) warnings () Warning messages: 1: In cor (x, y): standard deviation is zero 2: In cor (x, y): standard deviation is zero 3: In cor (x, y): standard deviation is zero 4: In cor (x, y): standard deviation is zero 5: In cor (x, y): standard deviation is zero 6: In cor (x, y): standard deviation is zero 7: In cor (x, y): standard deviation is zero 8: In cor (x, y): standard deviation is zero 9: In cor (x, y): standard deviation is zero 10: In cor (x, y): standard deviation is zero 11: In cor (x, y): standard deviation is zero 12: In cor (x, y): standard deviation is zero 13: In cor (x, y): standard deviation is zero 14: In cor (x, y): standard deviation is zero 15: In cor (x, y): standard deviation is zero 16: In cor (x, y): standard deviation is zero 17: In cor (x, y): standard deviation is zero 18: In cor (x, y): standard deviation is zero 19: In cor (x, y): standard deviation is zero 20: In cor (x, y): standard deviation is zero 21: In file (fn, "rb"): unable to open the file 'C:\Users\Ramiro Melinski\AppData\Local\Temp\RtmpOOFx1E\raster\r_tmp_2020-04-07_083225_1111610964.gri': No such file or directory
In all these cases, there is no final result of the parameterization. It seems obvious, but other species/sets (included some with 10 and 11 elements) resulted in warnings, but completed the process.
Running ENMevaluate using maxnet v.0.1.2 Doing random k-fold evaluation groups ... Of 4 total colors using 4 Running in parallel ... ENMeval completed in 8 minutes 36.7 seconds. Warning messages: 1: In cor (x, y): standard deviation is zero 2: In cor (x, y): standard deviation is zero 3: In cor (x, y): standard deviation is zero 4: In cor (x, y): standard deviation is zero 5: In cor (x, y): standard deviation is zero 6: In cor (x, y): standard deviation is zero 7: In cor (x, y): standard deviation is zero
The parameterization, then the SDM, of the vast majority of species occurred normally, including a species with only 9 occurrences, leaving me in doubt as to the cause of the problem. I have also tried to increase and decrease the number of background points, but the errors persist.
I thank you all in advance,
Ramiro