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
Just to let any users who are interested know, I finally solved this. It seems that MaxEnt
in biomod2
will not accept spaces in the file path to the maxent.jar
file, at least some of the time. I moved my files to a different directory without a space, and it now runs.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.