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

Question about BIOMOD_FormatingData() #439

Closed woaichixuegao closed 4 months ago

woaichixuegao commented 6 months ago

myRespName <- 'LS' DataSpecies <- read.csv('LS.csv') myResp <- as.numeric(DataSpecies[,myRespName]) myRespXY <- DataSpecies[, c("longitude","latitude")]

读取当前环境因子栅格数据

files <- list.files(path=paste("F:/666/current", sep=''), pattern='asc', full.names=TRUE) myExpl = rast(files)

建模前的数据处理,需要一定时间

myBiomodData1 <- BIOMOD_FormatingData(

  • resp.var = myResp,
  • expl.var = myExpl,
  • resp.xy = myRespXY,
  • resp.name = myRespName,
  • PA.nb.rep = 1, #重复数次
  • PA.nb.absences = 2068, # 随机缺失数据
  • PA.strategy = 'random'
  • )

! No data has been set aside for modeling evaluation ! No data has been set aside for modeling evaluation !!! Some data are located in the same raster cell. Please set filter.raster = TRUE if you want an automatic filtering.

Checking Pseudo-absence selection arguments...

  ! No data has been set aside for modeling evaluation

random pseudo absences selection All available cells have been selected ( 4 cells )

! Some NAs have been automatically removed from your data ! No data has been set aside for modeling evaluationError in .local(sp, env, ...) : No absences were given and no pseudo-absences were given or configured, at least one of those option is required.

HeleneBlt commented 6 months ago

Hi,

It seems you only have 4 cells available for Pseudo-absences data. If you have some NA in myResp, biomod2 will select the pseudo absences into these NA points. If you want biomod2 to select the PA into the other cells of the spat raster, you need to remove the NA from myResp.

Could you share the output of :

Thanks, Hélène

woaichixuegao commented 6 months ago

thank you,I have solved it!Have a good day!

---- Replied Message ---- | From | @.> | | Date | 03/25/2024 20:29 | | To | biomodhub/biomod2 @.> | | Cc | woaichixuegao @.>, Author @.> | | Subject | Re: [biomodhub/biomod2] Question about BIOMOD_FormatingData() (Issue #439) |

Hi,

It seems you only have 4 cells available for Pseudo-absences data. If you have some NA in myResp, biomod2 will select the pseudo absences into these NA points. If you want biomod2 to select the PA into the other cells of the spat raster, you need to remove the NA from myResp.

Could you share the output of :

summary(myResp) show(myExpl)

Thanks, Hélène

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>