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.
83 stars 22 forks source link

Help with BIOMOD_FormatingData - [The function cannot form a database of species information and environmental information] #507

Open liushuhao-666 opened 1 day ago

liushuhao-666 commented 1 day ago

Hi,

I'm using my own species information, including 0/1 and latitude and longitude, as well as environmental grids. I made sure that the species information was not duplicated and that the grid was fine. When I use the BIOMOD_FormatingData function, it doesn't work. See the result below.

I find this function does not work, I do not know why, please teach me how to solve it.

myExpl class : SpatRaster dimensions : 18, 15, 5 (nrow, ncol, nlyr) resolution : 0.5, 0.5 (x, y) extent : 119.75, 127.25, 26.25, 35.25 (xmin, xmax, ymin, ymax) coord. ref. : lon/lat WGS 84 (EPSG:4326) sources : bs_mean.img
bt_mean.img
depth_mean.img
... and 2 more source(s) names : bs, bt, depth, sss, sst min values : 30.2822, 9.984425, 16.00, 17.90484, 13.92985 max values : 34.8130, 25.676500, 138.25, 34.37285, 27.58349

Format Data with true absences

myBiomodData <- BIOMOD_FormatingData(resp.var = myResp,

  • expl.var = myExpl,
  • resp.xy = myRespXY,
  • resp.name =myRespName)

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= aoguanbianxia Data Formating -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

!!! Some data are located in the same raster cell. Please set filter.raster = TRUE if you want an automatic filtering. ! No data has been set aside for modeling evaluation ! Some NAs have been automatically removed from your data -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Done -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

myBiomodData

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= BIOMOD.formated.data -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

dir.name = .

sp.name = aoguanbianxia

 0 presences,  0 true absences and  0 undefined points in dataset

 5 explanatory variables

   bs            bt          depth          sss           sst     

Min. : NA Min. : NA Min. : NA Min. : NA Min. : NA
1st Qu.: NA 1st Qu.: NA 1st Qu.: NA 1st Qu.: NA 1st Qu.: NA
Median : NA Median : NA Median : NA Median : NA Median : NA
Mean :NaN Mean :NaN Mean :NaN Mean :NaN Mean :NaN
3rd Qu.: NA 3rd Qu.: NA 3rd Qu.: NA 3rd Qu.: NA 3rd Qu.: NA
Max. : NA Max. : NA Max. : NA Max. : NA Max. : NA

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

plot(myBiomodData) 错误于.plot.BIOMOD.formated.data.check.args(x = x, calib.lines = calib.lines, : coordinates are required to plot BIOMOD.formated.data objects

MayaGueguen commented 23 hours ago

Hello Mingmou,

Thank you for posting :pray:

That is strange indeed, as you both have no presences kept within your BIOMOD.formated.data object, nor values within your explanatory variables 👀

Could you please send the output of the sessionInfo() command ? Also, in order to check that both your explanatory variables and occurrence data are in the same projection system, could you try and plot them together ?

## For example with : 
plot(myExpl[[1]])
points(myRespXY, add = TRUE)

## But it might depend on the format of your object 

Maya