[R] SDM using BIOMOD2 error message
lindsiebug9
lma243 at nau.edu
Wed Dec 11 05:22:12 CET 2013
Hi
I am working on Species Distribution Modeling in R using BIOMOD2. When
picking my algorithms to model I keep getting an error message about length
(pred)
this is the code that I'm using
library(knitr)
library(markdown)
library(rgdal)
library(raster)
library(shapefiles)
library(biomod2)
library(dismo)
library(sp)
library(rgeos)
library(maptools)
library(MigClim)
setwd("V:/BIOCLIM")
bio2 <- raster("bio_2.bil")
bio5 <- raster("bio_5.bil")
bio6 <- raster("bio_6.bil")
bio15 <- raster ("bio_15.bil")
bio18 <- raster ("bio_18.bil")
bio19 <- raster ("bio_19.bil")
bio2 <- crop (bio2, extent (-112,-105,34,39))
bio5 <- crop (bio5, extent (-112,-105,34,39))
bio6 <- crop (bio6, extent (-112,-105,34,39))
bio15 <- crop (bio15, extent (-112,-105,34,39))
bio18 <- crop (bio18, extent (-112,-105,34,39))
bio19 <- crop (bio19, extent (-112,-105,34,39))
envStack <-stack (bio2, bio5,bio6,bio15,bio18, bio19)
rm
#bring in your presence or presence/absence data
setwd("C:/Users/Lindsie/Documents/R")
BH <- read.csv("occurrence_BH.csv")
head(BH)
myBiomodData=BIOMOD_FormatingData(resp.var=as.matrix(BH[,3]),expl.var=envStack,resp.xy=BH[,1:2],resp.name="Huntii",
PA.nb.rep=2, PA.nb.absences=909, PA.strategy="random",na.rm=TRUE)
myBiomodOption <- BIOMOD_ModelingOptions()
*myBiomodModelOut <- BIOMOD_Modeling(myBiomodData, models =
c("GLM","GBM","GAM","CTA","ANN","SRE","FDA","MARS","RF"), models.options =
myBiomodOption, NbRunEval = 1, DataSplit = 70, Yweights = NULL, VarImport =
3, models.eval.meth = c("ROC", "TSS", "KAPPA"), SaveObj = TRUE,
rescal.all.models = TRUE)*
at this point I get an error message that says
*Error in length(pred) : 'pred' is missing
*
any suggestions?
Thanks
--
View this message in context: http://r.789695.n4.nabble.com/SDM-using-BIOMOD2-error-message-tp4681993.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list