I am trying to fit some species distribution models using the biomod2
package in R.
I have compiled all of the required data such that biomod2
successfully fits models using all techniques except MaxEnt, which throws an error:
Error in file(file, "rt") : cannot open the connection
In addition: Warning messages:
1: running command 'java -mx512m -jar C:/Users/ajb273/inSync Share/PhD/Data/SDMs R/maxent.jar environmentallayers="Bushcrow/models/BushcrowFirstModeling/m_38411293/Back_swd.csv" samplesfile="Bushcrow/models/BushcrowFirstModeling/m_38411293/Sp_swd.csv" projectionlayers="Bushcrow/models/BushcrowFirstModeling/m_38411293/Predictions/Pred_swd.csv" outputdirectory="Bushcrow/models/BushcrowFirstModeling/Bushcrow_PA1_RUN10_MAXENT_outputs" outputformat=logistic redoifexists visible=FALSE linear=TRUE quadratic=TRUE product=TRUE threshold=TRUE hinge=TRUE lq2lqptthreshold=80 l2lqthreshold=10 hingethreshold=15 beta_threshold=-1 beta_categorical=-1 beta_lqp=-1 beta_hinge=-1 defaultprevalence=0.5 autorun nowarnings notooltips noaddsamplestobackground' had status 1
2: In file(file, "rt") :
cannot open file 'Bushcrow/models/BushcrowFirstModeling/Bushcrow_PA1_RUN10_MAXENT_outputs/Bushcrow_PA1_RUN10_Pred_swd.csv': No such file or directory
I thought this might be because biomod2
wasn't managing to find MaxEnt or Java, but I have the rJava
package loaded, and have tried running MaxEnt in the dismo
package, in the same R session, and it runs fine.
Does anyone have any idea what might be going on?
Thanks, Andrew
I had a similar connection problem and finally managed to fix it thus:
Running biomod2 this is the result i was getting:
And so I looked to my folder pathways
C:/A_R_ANALYSIS_ENGLAND
And within that there was indeed the followingand also the folder containing Java with its 220mb application
..and then I checked and recoded all the references to folder pathways as stated in BIOMOD_ModelingOptions() to ensure all correct. However it still did not work.. until.. I came out of R, switched it all off, rebooted and then it did start working.