sylvainschmitt / SSDM

Stacked Species Distribution Modelling R package
Other
41 stars 17 forks source link

Error in checkForRemoteErrors(val) : one node produced an error: comparison of these types is not implemented #107

Closed YoliswaM closed 4 months ago

YoliswaM commented 3 years ago

I hope you are well. I apologize for any inconvenience caused. I am fairly new to R, I am learning it as part of my research. I did the SSDM example that was used and everything worked with no errors. From what I understood from it, I used the code for my own data. My CSV file was one I converted from excel and it contains some repetition in the occurrence data. Most parts of the code work, even when I used SDM etc for a single species. The problem occurs when I used SSDM. I keep getting the error: "Error in checkForRemoteErrors(val) : one node produced an error: comparison of these types is not implemented".

setwd("C:\Users\YOLI..M\Documents\Masters_2021\Masters Data") library(SSDM) library(raster) setwd("C:\Users\YOLI..M\Documents\Masters_2021\Masters Data\Rasters") an_precip_20<-raster("an_precip_20.tif") an_precip_80<-raster("an_precip_80.tif") apan_mean_an<-raster("apan_mean_an.tif") cv_an_precip<-raster("cv_an_precip.tif") mean_an_prec<-raster("mean_an_prec.tif") mean_an_temp<-raster("mean_an_temp.tif") rain_seasons<-raster("rain_seasons.tif")

Env<-load_var(path=getwd(),files =c("an_precip_20.tif","an_precip_80.tif","apan_mean_an.tif","cv_an_precip.tif","mean_an_prec.tif","rain_seasons.tif"),verbose = FALSE) Env

setwd("C:\Users\YOLI..M\Documents\Masters_2021\Masters Data")

Occ<-load_occ(path=getwd(),Env,file = "ExcelData.csv",Xcol='long',Ycol='lat',verbose = FALSE) warnings() head(Occ) SSDM<-stack_modelling(c('CTA','SVM'),Occ,Env,rep=1,ensemble.thresh = 0,Xcol='long',Ycol = 'lat',Spcol = 'species',method = "pSSDM",verbose = FALSE)

This is my code. At this point in my research, I am still going through species distribution packages so that I can find a suitable one. And I am still learning more about different models and their suitability for my data. From what I understand from this error is that they may be an issue with my data set. I would like help, if any, with suggestions as to how to format or what to change about my data.

head(Occ) long lat species 16 25.60742 -26.39875 Chenopodium_glaucum_open_pan 32 25.20817 -28.46131 Chenopodium_glaucum_open_pan 33 24.62997 -29.61969 Chenopodium_glaucum_open_pan 34 24.63467 -29.61300 Chenopodium_glaucum_open_pan 35 25.49428 -29.13011 Chenopodium_glaucum_open_pan 36 25.86736 -29.01700 Chenopodium_glaucum_open_pan

Are the names too long? Are the "_" illegal? I have more than 5000 occurrences as this is a nationwide dataset. Is that too many?

Kind Regards, Yoliswa Mkhize

lukasbaumbach commented 3 years ago

Hi Yoliswa, hope this answer is not too late. Stack_modelling is the most error-prone function in the package, since it basically builds on top of everything else. It's a good sign, that single SDMs worked. I would recommend you to go through the functions step by step with increasing level of aggregation and see if the error persists: modelling --> ensemble using 2 or more Algorithm.SDM --> ensemble_modelling --> stacking using 2 or more Ensemble.SDM --> stack_modelling. It may also be worthwhile checking, that you are not running the function in parallel (the "node" error sounds a little bit like a parallelization issue), set cores=0. Lastly, you might also want to set verbose=TRUE, it might give you a better idea at which part the code is failing.

Best, Lukas