From pep.bioalerts at gmail.com Sun Oct 6 08:54:18 2013 From: pep.bioalerts at gmail.com (Josep M Serra diaz) Date: Sat, 5 Oct 2013 23:54:18 -0700 Subject: [Biomod-commits] Error in BIOMOD formating Message-ID: 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 From damien.georges2 at gmail.com Mon Oct 7 18:05:04 2013 From: damien.georges2 at gmail.com (Damien Georges) Date: Mon, 07 Oct 2013 18:05:04 +0200 Subject: [Biomod-commits] Error in BIOMOD formating In-Reply-To: References: Message-ID: <5252DBB0.7000602@gmail.com> Dear Josep, I guess the issue comes from the fact you try to generate pseudo absences from an inappropriate dataset (resp.var arg).. Is your 0 are "true absences" or non-information points? If they are true absences why do you want to generate pseudo absences? If they are not.. You have to code them as NA. Does it help? Best, Damien On 06/10/2013 08:54, Josep M Serra diaz wrote: > 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 done > Error 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 > > > >