<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>All</div><div><br></div><div><br></div><div>I am getting an error (below) using the Projection.raster function. </div><div><br></div><div><i>Error in model.frame.default(Terms, newdata, na.action = na.action, xlev = object$xlevels) : </i></div><div><div><i>  invalid type (list) for variable 'DataF'</i></div><div><i>In addition: Warning message:</i></div><div><i>'newdata' had 5711 rows but variable(s) found have 1131 rows</i></div></div><div><br></div><div><br></div><div><br></div><div>I thought part of the problem might relate to differences in the naming of my explanatory variables, but they appear to be the same in both my presence-absence site data (='SP.ENV') and my RasterStack (='CurrentStack').</div><div><i><br></i></div><div><i>> colnames(SP.ENV[,4:11])</i></div><div><div><div><i>[1] "bio_1"      "bio_3"      "bio_4"      "bio_5"      "bio_12"     "bio_14"     "bio_15"     "soil_aws"</i></div></div></div><div><div><i>> layerNames(CurrentStack)</i></div><div><i>[1] "bio_1"      "bio_3"      "bio_4"      "bio_5"      "bio_12"     "bio_14"     "bio_15"     "soil_aws"</i></div></div><div><br></div><div><br></div><div><br></div><div>Also, the row flags noted in the warning message don't correspond with dimensions of either dataset?</div><div><i><br></i></div><div><i>> dim(SP.ENV)</i></div><div><div><i>[1] 1742   75</i></div><div><i>> dim(CurrentStack)</i></div><div><i>[1] 232 238   8</i></div></div><div><br></div><div><br></div><div><br></div><div>Any suggestions? FYI, I am running the latest versions of R (2.14.1) and BIOMOD (1.1.7) and my calls are pasted below.</div><div><br></div><div><br></div><div><br></div><div>Cheers, </div><div>Jason</div><div><br></div><div><br></div><div>-- <br><br><b>Jason MacKenzie, PhD</b><br><i>Senior Conservation Fellow</i><br>The Nature Conservancy<br>201 Mission Street, 4th Floor<br>San Francisco, CA 94105<br><a href="mailto:jmackenzie@tnc.org" target="_blank">jmackenzie@tnc.org</a><i><br></i>jasonbmackenzie        [skype]</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4px; text-indent: -4px; font: normal normal normal 12px/normal Monaco; color: rgb(12, 32, 153); "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4px; text-indent: -4px; font: normal normal normal 12px/normal Monaco; color: rgb(12, 32, 153); ">library(<span style="color: #000000">raster</span>)</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4px; text-indent: -4px; font: normal normal normal 12px/normal Monaco; color: rgb(12, 32, 153); ">library(<span style="color: #000000">BIOMOD</span>)</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4px; text-indent: -4px; font: normal normal normal 12px/normal Monaco; min-height: 16px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4px; text-indent: -4px; font: normal normal normal 12px/normal Monaco; color: rgb(176, 20, 9); "><span style="color: #0c2099">setwd(</span>"~/Documents/R/R_data/SD/veg4"<span style="color: #0c2099">)</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4px; text-indent: -4px; font: normal normal normal 12px/normal Monaco; color: rgb(176, 20, 9); "><span style="color: #000000">SP.ENV </span><span style="color: #0c2099"><-</span><span style="color: #000000"> </span><span style="color: #0c2099">read.table(</span>"SPENV_veg4.txt"<span style="color: #0c2099">,</span><span style="color: #000000">  h</span><span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span><span style="color: #000000"> sep</span><span style="color: #0c2099">=</span>"\t"<span style="color: #0c2099">)</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4px; text-indent: -4px; font: normal normal normal 12px/normal Monaco; color: rgb(176, 20, 9); "><span style="color: #000000">COORxy </span><span style="color: #0c2099"><-</span><span style="color: #000000"> </span><span style="color: #0c2099">read.table(</span>"CoorXY_veg4.txt"<span style="color: #0c2099">,</span><span style="color: #000000"> h</span><span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span><span style="color: #000000"> sep</span><span style="color: #0c2099">=</span>"\t"<span style="color: #0c2099">)</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4px; text-indent: -4px; font: normal normal normal 12px/normal Monaco; min-height: 16px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4px; text-indent: -4px; font: normal normal normal 12px/normal Monaco; "><span style="color: #0c2099">Initial.State(</span>Response<span style="color: #0c2099">=</span>SP.ENV<span style="color: #0c2099">[,</span><span style="color: #055219">12</span><span style="color: #0c2099">:</span><span style="color: #055219">13</span><span style="color: #0c2099">],</span> Explanatory<span style="color: #0c2099">=</span>SP.ENV<span style="color: #0c2099">[,</span><span style="color: #055219">4</span><span style="color: #0c2099">:</span><span style="color: #055219">11</span><span style="color: #0c2099">],</span> IndependentResponse<span style="color: #0c2099">=</span><span style="color: #c3892b">NULL</span><span style="color: #0c2099">,</span> IndependentExplanatory<span style="color: #0c2099">=</span><span style="color: #c3892b">NULL</span><span style="color: #0c2099">)</span></div><p style="margin: 0.0px 0.0px 0.0px 4.0px; text-indent: -4.0px; font: 12.0px Monaco; min-height: 16.0px"><span class="Apple-tab-span" style="white-space:pre">                                        </span><br class="webkit-block-placeholder"></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4px; text-indent: -4px; font: normal normal normal 12px/normal Monaco; "><span style="color: #0c2099">Models(</span>GLM<span style="color: #0c2099">=</span><span style="color: #c3892b">F</span><span style="color: #0c2099">,</span> TypeGLM<span style="color: #0c2099">=</span><span style="color: #b01409">"quad"</span><span style="color: #0c2099">,</span> Test<span style="color: #0c2099">=</span><span style="color: #b01409">"AIC"</span><span style="color: #0c2099">,</span> GAM<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> Spline<span style="color: #0c2099">=</span><span style="color: #055219">4</span><span style="color: #0c2099">,</span> GBM<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> No.trees<span style="color: #0c2099">=</span><span style="color: #055219">3000</span><span style="color: #0c2099">,</span> CTA<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> CV.tree<span style="color: #0c2099">=</span><span style="color: #055219">50</span><span style="color: #0c2099">,</span> ANN<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> CV.ann<span style="color: #0c2099">=</span><span style="color: #055219">3</span><span style="color: #0c2099">,</span> SRE<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> quant<span style="color: #0c2099">=</span><span style="color: #055219">0.025</span><span style="color: #0c2099">,</span> FDA<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> MARS<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> RF<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> NbRunEval<span style="color: #0c2099">=</span><span style="color: #055219">3</span><span style="color: #0c2099">,</span> DataSplit<span style="color: #0c2099">=</span><span style="color: #055219">70</span><span style="color: #0c2099">,</span> Yweights<span style="color: #0c2099">=</span><span style="color: #c3892b">NULL</span><span style="color: #0c2099">,</span> Roc<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> Optimized.Threshold.Roc<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> Kappa<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> TSS<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> KeepPredIndependent<span style="color: #0c2099">=</span><span style="color: #c3892b">F</span><span style="color: #0c2099">,</span> VarImport<span style="color: #0c2099">=</span><span style="color: #055219">5</span><span style="color: #0c2099">,</span> NbRepPA<span style="color: #0c2099">=</span><span style="color: #055219">2</span><span style="color: #0c2099">,</span> strategy<span style="color: #0c2099">=</span><span style="color: #b01409">"sre"</span><span style="color: #0c2099">,</span> nb.absences<span style="color: #0c2099">=</span><span style="color: #055219">1000</span><span style="color: #0c2099">)</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4px; text-indent: -4px; font: normal normal normal 12px/normal Monaco; min-height: 16px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4px; text-indent: -4px; font: normal normal normal 12px/normal Monaco; "><span style="color: #0c2099">CurrentPred(</span>GLM<span style="color: #0c2099">=</span><span style="color: #c3892b">F</span><span style="color: #0c2099">,</span> GAM<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> GBM<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> CTA<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> ANN<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> SRE<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> FDA<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> MARS<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> RF<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> BinRoc<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span>  BinKappa<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span>  BinTSS<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> FiltRoc<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> FiltKappa<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> FiltTSS<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">)</span> </div><p style="margin: 0.0px 0.0px 0.0px 4.0px; text-indent: -4.0px; font: 12.0px Monaco; min-height: 16.0px"><span class="Apple-tab-span" style="white-space:pre">                                                         </span><br class="webkit-block-placeholder"></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4px; text-indent: -4px; font: normal normal normal 12px/normal Monaco; "><span style="color: #0c2099">PredictionBestModel(</span>method<span style="color: #0c2099">=</span><span style="color: #b01409">'all'</span><span style="color: #0c2099">,</span> Bin.trans<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> Filt.trans<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">)</span><span class="Apple-tab-span" style="white-space:pre">   </span></div><p style="margin: 0.0px 0.0px 0.0px 4.0px; text-indent: -4.0px; font: 12.0px Monaco; min-height: 16.0px"><span class="Apple-tab-span" style="white-space:pre">               </span><br class="webkit-block-placeholder"></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4px; text-indent: -4px; font: normal normal normal 12px/normal Monaco; color: rgb(176, 20, 9); "><span style="color: #000000">files </span><span style="color: #0c2099"><-</span><span style="color: #000000"> </span><span style="color: #0c2099">list.files(</span>"~/Documents/R/R_data/SD/raster/current"<span style="color: #0c2099">,</span><span style="color: #000000"> pattern</span><span style="color: #0c2099">=</span>'asc'<span style="color: #0c2099">,</span><span style="color: #000000"> full.names</span><span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">)</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4px; text-indent: -4px; font: normal normal normal 12px/normal Monaco; color: rgb(12, 32, 153); "><span style="color: #000000">CurrentStack </span><-<span style="color: #000000"> </span>stack(<span style="color: #000000">files</span>[c(<span style="color: #055219">1</span>,<span style="color: #055219">13</span>,<span style="color: #055219">14</span>,<span style="color: #055219">15</span>,<span style="color: #055219">4</span>,<span style="color: #055219">6</span>,<span style="color: #055219">7</span>,<span style="color: #055219">20</span>)])</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4px; text-indent: -4px; font: normal normal normal 12px/normal Monaco; min-height: 16px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4px; text-indent: -4px; font: normal normal normal 12px/normal Monaco; "><span style="color: #0c2099">Projection.raster(</span>RasterProj <span style="color: #0c2099">=</span> CurrentStack<span style="color: #0c2099">,</span> <a href="http://Proj.name">Proj.name</a><span style="color: #0c2099">=</span><span style="color: #b01409">'CurrentRaster'</span><span style="color: #0c2099">,</span> GLM<span style="color: #0c2099">=</span><span style="color: #c3892b">F</span><span style="color: #0c2099">,</span> GAM<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> GBM<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> CTA<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> ANN<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> SRE<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> quant<span style="color: #0c2099">=</span><span style="color: #055219">0.025</span><span style="color: #0c2099">,</span> FDA<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> MARS<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> RF<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> BinRoc<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> BinKappa<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> BinTSS<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> FiltRoc<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> FiltKappa<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> FiltTSS<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> repetition.model<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> stack.out<span style="color: #0c2099">=</span><span style="color: #c3892b">T</span><span style="color: #0c2099">,</span> compress<span style="color: #0c2099">=</span><span style="color: #b01409">"gzip"</span><span style="color: #0c2099">)</span></div></div></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4px; text-indent: -4px; font: normal normal normal 12px/normal Monaco; "><span style="color: #0c2099"><br></span></div><div><br></div>
<br></body></html>