[Biomod-commits] Cannot find rasters for different rules of ensembleForecasting

Damien Georges damien.georges2 at gmail.com
Mon Mar 4 09:52:14 CET 2013


Dear Josep,

I made some change in saved files names since a while to make them more 
coherent within biomod2.. Moreover, if you work with raster objects, 
default projections will be .grd files (raster format). So you have to 
read this files with stack(...) function rather than with load(...)
Last point is if you want to make "total consensus" models (taking all 
models outputs to make single model), you have to build it at 
BIOMOD_EnsembleModeling(...), step setting em.by arg to 'all'.

In your case you produced enemble-models that take all algo (GLM, 
RF....) for each PA dataset and each CV run.
  So you have 4 different ensemble-models projections :

ef1 <- stack("proj_t2050_Myocastor_PA1_Full_AllAlgos_EMbyTSS.grd")
ef2 <- stack("proj_t2050_Myocastor_PA1_RUN1_AllAlgos_EMbyTSS.grd" )
ef3 <- stack( "proj_t2050_Myocastor_PA2_Full_AllAlgos_EMbyTSS.grd" )
ef4 <- stack("proj_t2050_Myocastor_PA2_RUN1_AllAlgos_EMbyTSS.grd")

Hope that helps,

Best,

Damien.


On 01/03/2013 16:06, Josep M Serra diaz wrote:
> Dear Damien,
>
> sorry I did not explain myself, ...the main thing is that this object 
> does not exist after running biomod2, and if I try the example step by 
> step, this object is not created either....
>
>
> > ls()
>
>  [1] "myBiomodData"       "myBiomodEF" "myBiomodEM"         
> "myBiomodModelEval"  "myBiomodModelOut" "myBiomodOption"     
> "myBiomomodProj"
>  [8] "myBiomomodProj2050" "myCurrentProj" "myExpl"             
> "myExpl2050"         "myResp" "myResp.ras"         "myRespName"
> [15] "myRespXY"
>
>
> > list.files(path='~/Myocastor/proj_t2050')
>
>  [1] "proj_t2050_ClampingMask.grd" "proj_t2050_ClampingMask.gri" 
> "proj_t2050_Myocastor_PA1_Full_AllAlgos_EMbyTSS.grd"
>  [4] "proj_t2050_Myocastor_PA1_Full_AllAlgos_EMbyTSS.gri" 
> "proj_t2050_Myocastor_PA1_RUN1_AllAlgos_EMbyTSS.grd" 
> "proj_t2050_Myocastor_PA1_RUN1_AllAlgos_EMbyTSS.gri"
>  [7] "proj_t2050_Myocastor_PA2_Full_AllAlgos_EMbyTSS.grd" 
> "proj_t2050_Myocastor_PA2_Full_AllAlgos_EMbyTSS.gri" 
> "proj_t2050_Myocastor_PA2_RUN1_AllAlgos_EMbyTSS.grd"
> [10] "proj_t2050_Myocastor_PA2_RUN1_AllAlgos_EMbyTSS.gri" 
> "proj_t2050_Myocastor_ROCbin.grd" "proj_t2050_Myocastor_ROCbin.gri"
> [13] "proj_t2050_Myocastor.grd" "proj_t2050_Myocastor.gri"
>
>
>
> Therefore:
>
> load("Myocastor/proj_t2050/Myocastor_PA1_AllRun_EM.TSS")
> Error in readChar(con, 5L, useBytes = TRUE) : cannot open the connection
> In addition: Warning message:
> In readChar(con, 5L, useBytes = TRUE) :
>   cannot open compressed file 
> 'Myocastor/proj_t2050/Myocastor_PA1_AllRun_EM.TSS', probable reason 
> 'No such file or directory'
>
>
>
>
>
>
> ######### do not know if this helps
>
> > sessionInfo()
> R version 2.15.2 (2012-10-26)
> Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
>
> locale:
> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
>
> attached base packages:
> [1] splines   stats     graphics  grDevices utils     datasets 
> methods   base
>
> other attached packages:
>  [1] mgcv_1.7-22        randomForest_4.6-7 mda_0.4-2 
> class_7.3-5        gbm_2.0-8          lattice_0.20-13 
> survival_2.37-2    MASS_7.3-23
>  [9] rpart_4.1-0        nnet_7.3-5         rgdal_0.8-5 
> biomod2_2.0.0      raster_2.0-41      sp_1.0-5 abind_1.4-0
>
> loaded via a namespace (and not attached):
> [1] grid_2.15.2   Matrix_1.0-11 nlme_3.1-108
>
>
> 2013/3/1 Damien Georges <damien.georges2 at gmail.com 
> <mailto:damien.georges2 at gmail.com>>
>
>     Dear Josep,
>
>
>
>     On 01/03/2013 15:28, Josep M Serra diaz wrote:
>
>         Dear BIOMODers,
>
>         I have been running bimod2 for my first time (great vignettes,
>         by the way)
>         and I am struggling to find the rasters/rasterStack that shows
>         different
>         ensembleForecasting according to different assembly rules
>          (e.g. em.cv <http://em.cv>,
>         em.mean, etc.). So I ended up running the script of the
>         example to check
>         whether I was confused or I did something wrong.
>
>         ...and I found that after running the whole example, I cannot
>         load either
>         this rasterStack.
>
>         I mean this part of the code:
>
>
>         ###################################################
>         ### code chunk number 19: EnsembleForecasting_loading_res
>         ###################################################
>         load("Myocastor/proj_t2050/Myocastor_PA1_AllRun_EM.TSS")
>         Myocastor_PA1_AllRun_EM.TSS
>
>
>         ###################################################
>         ### code chunk number 20: EnsembleForecasting_plotting_res
>         ###################################################
>         plot(Myocastor_PA1_AllRun_EM.TSS)
>
>
>
>         QUESTIONS:
>         1. Where can I find these different ensembles projections?
>
>     Ensemble-projections are within the object you just loaded. It's a
>     multidimentional object, here a rasterStack where each layer is
>     one ensemble model (e.g. mean, cv,...). You can know which is what
>     with layer names :
>
>     names(Myocastor_PA1_AllRun_EM.TSS)
>
>
>         2. The assembly rule (the way the ensemble is done;
>         mean/median/committee)
>         does not interfere with 'em.by <http://em.by>' value in
>         BIOMOD_EnsembleModeling()
>         function. Is that correct? I mean, we can always ask to
>         ensamble using the
>         median of the predictions, or committee, but across different
>         subsets (PA,
>         PA+algo, all, etc.)
>
>     Exactly !
>
>
>     Cheers,
>
>     Damien
>
>
>         Thanks,
>
>         pep
>         _______________________________________________
>         Biomod-commits mailing list
>         Biomod-commits at lists.r-forge.r-project.org
>         <mailto:Biomod-commits at lists.r-forge.r-project.org>
>         https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/biomod-commits
>
>
>



More information about the Biomod-commits mailing list