Hi all,<br>This is my first run in BIOMOD, and I'm afraid I'm having troubles with Projection.raster. Here I attach de script I used, function Models() runs nicely, but then I have an error message when trying to run Projection.raster. Anybody has an idea why I get this error message?<br>
<br>ovit <br>Error en as.numeric(g) : <br> cannot coerce type 'S4' to vector of type 'double'<br><br><br>sdmdata<-read.csv("sdmdata.csv")<br>head(sdmdata)<br> idw x y ibe_biof1 ibe_biof10 ibe_biof11 ibe_biof12 ibe_biof13<br>
1 1 -2.238898 37.92525 114 203 39 561 72<br>2 2 -1.704232 37.92057 113 199 40 568 73<br>3 3 -2.064232 38.23942 114 201 39 551 71<br>
4 4 -3.764231 40.95501 100 185 26 532 62<br>5 5 -2.638544 42.54070 123 195 55 611 64<br>6 6 -3.764483 40.95520 100 185 26 532 62<br>
ibe_biof14 ibe_biof15 ibe_biof16 ibe_biof17 ibe_biof18 ibe_biof19 ibe_biof2<br>1 16 34 190 71 72 152 118<br>2 19 31 188 80 81 143 116<br>
3 17 33 186 75 75 140 119<br>4 18 28 162 78 86 138 104<br>5 32 19 178 122 122 160 97<br>
6 18 28 162 78 86 138 104<br> ibe_biof3 ibe_biof4 ibe_biof5 ibe_biof6 ibe_biof7 ibe_biof8 ibe_biof9<br>1 38 6472 296 -13 309 91 202<br>
2 38 6255 286 -13 299 89 197<br>3 38 6425 294 -15 309 92 201<br>4 36 6286 266 -17 283 60 184<br>
5 38 5484 265 15 250 90 195<br>6 36 6286 266 -17 283 60 184<br> ibe_elevf pv<br>1 1317 1<br>2 1408 1<br>3 1370 1<br>
4 1244 1<br>5 503 1<br>6 1244 1<br><br>Initial.State(Response = sdmdata[,24], Explanatory = sdmdata[,c(23,4,14,17)],IndependentResponse = NULL,<a href="http://sp.name">sp.name</a>="ovit")<br><br>
Models(GLM = F, TypeGLM = "poly", Test = "AIC", GBM = F, No.trees = 2000, GAM = T, Spline = 3, CTA = F, CV.tree = 50, ANN = F, CV.ann = 2, SRE = F, quant=0.025, FDA = F,MARS = F, RF = F, NbRunEval = 4, DataSplit = 80, Yweights=NULL, Roc = T, Optimized.Threshold.Roc = T, Kappa = T, TSS=T, KeepPredIndependent = F, VarImport=F, NbRepPA=0)<br>
Biomod.Manual()<br><br>CurrentPred(GLM=T, GBM=T, GAM=T, CTA=T, ANN=T, SRE=T, MARS=F, RF=T,BinRoc=T, BinKappa=T, BinTSS=T, FiltKappa=T)<br><br>files <- list.files("\\encuadre iberico",pattern='asc', full.names=TRUE )<br>
pred.1 <- stack(files[c(1,14,11,20)])<br><br>Projection.raster(RasterProj = pred.1, Proj.name='Pred.ovit1', GLM = T, GBM = T, GAM = T,CTA = T, ANN = T, SRE = T, MARS = T, RF = T,BinRoc = T, BinKappa = T, BinTSS = T, FiltRoc = T, FiltKappa = T, FiltTSS = T,repetition.model=T)<br clear="all">
<br>-- <br>Nagore García Medina. <a href="mailto:ngmedina@gmail.com">ngmedina@gmail.com</a><br>