biomodhub / biomod2

BIOMOD is a computer platform for ensemble forecasting of species distributions, enabling the treatment of a range of methodological uncertainties in models and the examination of species-environment relationships.
89 stars 22 forks source link

biomod2 4.2-6-2--if we need to rename the future environmental variables to match those of the current period #549

Open tongruiju opened 2 days ago

tongruiju commented 2 days ago

Hi, I used the current ensemble model to predict the future distribution with future environmental variables and encountered an error. I'm wondering if we need to rename the future environmental variables to match those of the current period. Despite changing the names of the TIFF files, the error persists. Why is that? Best, Ruiju

**> myExpl2040 <- stack(list.files(path = 'E:\paper11\BioOracleTIFPJ\ssp126\EnVar2040', full.names = TRUE, pattern = "\.tif$"))

myBiomodProjectionFuture126_2040 <- BIOMOD_EnsembleForecasting(bm.em = myBiomodEM,

  • proj.name = 'FutureEM126_2040',
  • new.env = myExpl2040,
  • models.chosen = 'all',
  • metric.binary = 'TSS',
  • metric.filter = 'ROC')

-=-=-=-=-=-=-=-=-=-=-=-=-= Do Ensemble Models Projection -=-=-=-=-=-=-=-=-=-=-=-=-= Error in .fun_testIfIn(TRUE, "names(new.env)", names(new.env), bm.em@expl.var.names, :

names(new.env) must be 'BPI9', 'gebco2023PJ_clip', 'o2_mean_2000PJ', 'oa_co3_TRI_MPI20002014_co3satarag_Can20002014_IDW3DPJ_clip1', 'ph_mean_2000PJ', 'phyc_mean_2000PJ', 'si_mean_2000PJ', 'slope', 'so_mean_2000PJ', 'swd_mean_2000PJ', 'sws_mean_2000PJ', 'thetao_mean_2000PJ', 'TPI', 'wld01_grz_idw3d_ProjminPJ_clip1' or 'wld01_rck_idw3d_Projmin_PJ_clip1**

HeleneBlt commented 2 days ago

Hi Ruiju,

The names of the new variables must be the same of the ones used for the models, and you need all the variables. Here you need to check whether names(myExpl2040) is identical to names(myExpl2000).

Best, Hélène