[R-sig-Geo] Error maxentResults.csv not found

Robert J. Hijmans r.hijmans at gmail.com
Thu Feb 20 21:53:21 CET 2014


Narayani:

There is not much to add to what Lionel said. In R, model fitting and
prediction are separate steps. I would suggest studying the manual,
and following the examples. See:

library(dismo)
?maxent
vignette('sdm')

Robert

On Thu, Feb 20, 2014 at 8:59 AM, Narayani Barve <narayani at ku.edu> wrote:
> Hi Lionel,
>
> Thank you very much for the input. But I was thinking the first two
> arguments is for fitting the model and then the projectionlayers and
> environmentallayers arguments are for predicting the model? Because if we
> pass only two arguments viz, predictors and occurrences, it only only fits
> the model. To get the actual prediction, predict function is required. I am
> not very sure about this. May be expert can shade some light on this.
>
> Regards,
> Narayani
>
>
> On Thu, Feb 20, 2014 at 10:11 AM, Lionel <s6lihert at uni-bonn.de> wrote:
>
>> Hi Narayani,
>>
>> The maxent function in R do not need all the arguments you provided, try
>> giving first only the Rasters (predictors) and the occurrence points
>> (occur), check that your predictors and occur object are not empty and
>> contain the environmental variables and the location and then run maxent
>> only with these two arguments. Then you could try to build on this and
>> add some of the arguments that you provided like "nowarnings", but in
>> the code that you gave below some arguments are redundant, for example
>> you give two times the environmental layers, the first time when you
>> pass them to the function through the predictors object and the second
>> time by specifying in the args a path to the environmental layers. I
>> guess this might cause some errors.
>>
>> Hope this helps,
>> Lionel
>>
>> On 02/20/2014 04:58 PM, Narayani Barve wrote:
>> > Hi All,
>> >
>> > I would like to run maxent models for 100's of species. Hence, I am
>> running
>> > maxent using "dismo" package in R. I have to pass many arguments to
>> maxent,
>> > so call I have given to maxent is as given below
>> >
>> > xm2 <- maxent(predictors, occur, args=c("nowarnings",
>> >                                             "noprefixes",
>> >                                             "responsecurves",
>> >                                             "jackknife",
>> >                                             "outputformat=raw",
>> >
>> > "outputdirectory=F:\\ModelOutputCli\\MOD1\\test",
>> >
>> > "projectionlayers=F:\\maxent_test\\env_layers_fut\\CC2650"),
>> >
>> > "samplesfile=F:\\DistFilt\\5minutes\\Aca_cia.csv",
>> >
>> > "environmentallayers=F:\\crop_rasters_Ms_5\\Aca_cia"),
>> >                                             "randomseed",
>> >                                             "replicates=3",
>> >                                             "replicatetype=bootstrap",
>> >                                             "nodoclamp"))
>> >
>> > Unfortunately, the function does not execute and I get following message.
>> > Can anyone shade light on this error? I have given sessionInfo() below
>> the
>> > error message
>> >
>> > Any help is appreciated,
>> >
>> > Regards,
>> > Narayani
>> >
>> > Warning messages:
>> > 1: In .local(x, p, ...) :
>> >    5 (7.81%) of the presence points have NA predictor values
>> > 2: In file(file, "rt") :
>> >    cannot open file
>> >
>> 'C:/Users/Narayani/AppData/Local/Temp/R_raster_Narayani/maxent/1826517661/maxentResults.csv':
>> > No such file or directory
>> > Error in t(read.csv(paste(dirout, "/maxentResults.csv", sep = ""))) :
>> >    error in evaluating the argument 'x' in selecting a method for
>> function
>> > 't': Error in file(file, "rt") : cannot open the connection
>> >
>> >
>> >
>> >> sessionInfo()
>> > R version 3.0.2 (2013-09-25)
>> > Platform: x86_64-w64-mingw32/x64 (64-bit)
>> >
>> > locale:
>> > [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United
>> > States.1252    LC_MONETARY=English_United States.1252
>> > [4] LC_NUMERIC=C                           LC_TIME=English_United
>> > States.1252
>> >
>> > attached base packages:
>> > [1] stats     graphics  grDevices utils     datasets  methods   base
>> >
>> > other attached packages:
>> > [1] rJava_0.9-6  rgdal_0.8-14 dismo_0.9-3  raster_2.2-5 sp_1.0-14
>> >
>> > loaded via a namespace (and not attached):
>> > [1] grid_3.0.2      lattice_0.20-23 tools_3.0.2
>> >
>> >       [[alternative HTML version deleted]]
>> >
>> > _______________________________________________
>> > R-sig-Geo mailing list
>> > R-sig-Geo at r-project.org
>> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>>
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo



More information about the R-sig-Geo mailing list