[Biomod-commits] Error in BIOMOD formating

Josep M Serra diaz pep.bioalerts at gmail.com
Sun Oct 6 08:54:18 CEST 2013


Dear BIOMODers,

I am recuperating some of my modeling performed with the older BIOMOD
function. I cannot get my way around with the first step and I do not see
why:

Data format I am using is the same as the inputs available to the former
version:

  1 data frame with SpeciesPresenceAbsence (1/0) and the explanatory
variables , and the coordinates.

> class(Sp.Env)[1] "data.frame"

> myBiomodData <- BIOMOD_FormatingData(resp.var = as.numeric(Sp.Env[,c("PISA2")]),+ expl.var = Sp.Env[,c("BIO1","BIO12","BIO14","BIO5","BIO6")],+ resp.xy = Sp.Env[,c('MAPX','MAPY')],+ resp.name = 'SpeciesNAME',+ PA.nb.rep = 3,+ PA.nb.absences = 5000,+ PA.strategy = 'random')

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= PISA2 Data Formating
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

      ! No data has been set aside for modeling evaluation
   > Pseudo Absences Selection checkings...
    ! There is more 'true absences' than desired pseudo absences. No
pseudo absences selection done.
   ! PA selection not doneError in (function (classes, fdef, mtable)  :
  unable to find an inherited method for function
‘BIOMOD.formated.data’ for signature ‘"SpatialPointsDataFrame",
"data.frame"




I ALSO TRIED THE FOLLOWING: removing as. numeric, ....but then the
problem is the following

> myBiomodData <- BIOMOD_FormatingData(resp.var = Sp.Env[,c("PISA2")],+                                      expl.var = Sp.Env[,c("BIO1","BIO12","BIO14","BIO5","BIO6")],+                                      resp.xy = Sp.Env[,c('MAPX','MAPY')],+                                      resp.name = 'PISA2',+                                      PA.nb.rep = 3,+                                      PA.nb.absences = 5000,+                                      PA.strategy = 'random')
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= PISA2 Data Formating
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=Error in
.BIOMOD_FormatingData.check.args(resp.var, expl.var, resp.xy,  :
  Response variable must be one of numeric, data.frame, matrix,
RasterLayer, RasterStack, SpatialPointsDataFrame, SpatialPoints




ANY IDEAS? I am sure it has to be something very stupid from me.

It seems that the function is understanding I am mixing
SpatialPointsDataFrame and data.frame... so I also tried


> myBiomodData <- BIOMOD_FormatingData(resp.var = Sp.Env[,c("PISA2")],+                                      expl.var = Sp.Env[,c("BIO1","BIO12","BIO14","BIO5","BIO6")],+                                      #resp.xy = Sp.Env[,c('MAPX','MAPY')],+                                      resp.name = 'PISA2',+                                      PA.nb.rep = 3,+                                      PA.nb.absences = 5000,+                                      PA.strategy = 'random')
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= PISA2 Data Formating
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=Error in
.BIOMOD_FormatingData.check.args(resp.var, expl.var, resp.xy,  :
  Response variable must be one of numeric, data.frame, matrix,
RasterLayer, RasterStack, SpatialPointsDataFrame, SpatialPoints



Any help will be very wellcome!!!!!!!!!

Thanks

pep


More information about the Biomod-commits mailing list