mercredi 10 août 2022

error in SRE pseudo absences selection in biomod2

I run BIOMOD_FormatingData from package "biomod2" in R to get pseudo absences data. It works for other methods such as "random" and "disk", but not for "are".

I got the error and warnings:

SRE pseudo absences selection Error in pa.data.tmp$xy[which((pa.data.tmp$sp != 1 | is.na(pa.data.tmp$sp)) & : subscript out of bounds

In addition: Warning messages:

1: In pa.data.tmp$sp == 1 & as.data.frame(pa.data.tmp$pa.tab)[, pa] : longer object length is not a multiple of shorter object length

2: In (pa.data.tmp$sp != 1 | is.na(pa.data.tmp$sp)) & as.data.frame(pa.data.tmp$pa.tab)[, : longer object length is not a multiple of shorter object length

Does anyone know this? Below is my code:

 Anneslea.pa <- BIOMOD_FormatingData(resp.var = species.sp$Anneslea,
                                    expl.var = bio.crop,
                                    resp.xy = coordinates(species.sp),
                                    resp.name = 'Anneslea',
                                    #eval.resp.var = species.sp.ex.tst$pco,
                                    #eval.expl.var = env,
                                    #eval.resp.xy = coordinates(species.sp.ex.tst),
                                    PA.nb.rep = 10,
                                    PA.nb.absences = dim(species.sp)[1],
                                    PA.strategy = 'sre',
                                    PA.dist.min = NULL, # for 'disk' strategy
                                    PA.dist.max = NULL, # for 'disk' strategy
                                    PA.sre.quant = 0.1,
                                    PA.table = NULL,
                                    na.rm = TRUE)"



Aucun commentaire:

Enregistrer un commentaire