<p><!--begin_signature-->Hi,</p>
  <p>I'm getting this error message when I run my projections on future climate data:</p>
  <p>In predict.lm(object, newdata, se.fit, scale = 1, type = ifelse(type ==&nbsp; ... :<br />
&nbsp; prediction from a rank-deficient fit may be misleading</p>
  <p>I wonder if anyone can help?&nbsp; I paste my code below.</p>
  <p>Many thanks,</p>
  <p>Raquel&nbsp;</p>
  <p><br /></p>
  <div>### CALIBRATION AND VALIDATION ##############################</div> 
  <div><br />path &lt;- &quot;C:/Raquel_Garcia/fourthRun&quot;</div> 
  <div>taxa &lt;- c(&quot;frogs&quot;,&quot;snakes&quot;,&quot;mammals&quot;,&quot;birds&quot;)</div> 
  <div>library(BIOMOD)<br />source(&quot;C:/Raquel_Garcia/ModelsH.r&quot;)<br />source(&quot;C:/Raquel_Garcia/thirdRun/Ensemble.Forecasting.r&quot;)</div> 
  <div>clim &lt;- c(&quot;clust1_4160a2&quot;,&nbsp; &quot;clust2_4160a2&quot;,&nbsp; &quot;clust3_4160a2&quot;,&nbsp; &quot;clust1_4160a1b&quot;,<br />&quot;clust2_4160a1b&quot;, &quot;clust3_4160a1b&quot;, &quot;clust1_4160b1&quot;,&nbsp; &quot;clust2_4160b1&quot;, <br />

&quot;clust3_4160b1&quot;,&nbsp; &quot;clust1_8100a2&quot;,&nbsp; &quot;clust2_8100a2&quot;,&nbsp; &quot;clust3_8100a2&quot;, <br />&quot;clust1_8100a1b&quot;, &quot;clust2_8100a1b&quot;, &quot;clust3_8100a1b&quot;, &quot;clust1_8100b1&quot;, <br />

&quot;clust2_8100b1&quot;,&nbsp; &quot;clust3_8100b1&quot;)</div> 
  <div> </div> 
  <div>for (tx in 1:4)<br />&nbsp; {<br />#dir.create(paste(path, taxa[tx], sep=&quot;/&quot;))<br />taxapath &lt;- paste(path, taxa[tx],sep=&quot;/&quot;)</div> 
  <div><br />### CALIBRATION ################################################################</div> 
  <div>setwd(paste(path,&quot;Data&quot;,sep=&quot;/&quot;))</div> 
  <div>species&lt;-read.table(paste(taxa[tx],&quot;_1851cells_spp15.txt&quot;,sep=&quot;&quot;),h=T,sep=&quot;\t&quot;)&nbsp;&nbsp;&nbsp; <br />sppnames &lt;- names(species)</div> 
  <div>clim6190&lt;-get(load(&quot;var6190_1851cells_3var&quot;))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # present climate table</div> 
  <div>coor&lt;-read.table(paste(&quot;coorXY_1851cells.txt&quot;,sep=&quot;&quot;),h=T,sep=&quot;\t&quot;)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />coorXY &lt;- coor[,2:3]<br /> </div> 
  <div><br />for (f in 1:length(sppnames))<br />&nbsp; {<br />&nbsp; dir.create(paste(taxapath, &quot;/&quot;, sppnames[f], sep=&quot;&quot;))</div> 
  <div>&nbsp; setwd(paste(taxapath, &quot;/&quot;, sppnames[f], sep=&quot;&quot;))</div> 
  <div> <br />&nbsp; Initial.State(Response=species[,f], Explanatory=clim6190[,4:6], IndependentResponse=NULL, IndependentExplanatory=NULL,<a target="_blank" href="http://sp.name/">sp.name</a>=sppnames[f])</div> 
  <div>&nbsp; ModelsH(GLM = T, TypeGLM = &quot;poly&quot;, Test = &quot;AIC&quot;, GBM = T, No.trees = 2000, GAM = T,<br />&nbsp; Spline = 3, CTA = F, CV.tree = 50, ANN = T, CV.ann = 5, SRE = F, q=0.0025, FDA = T,<br />&nbsp; MARS = T, RF = T, NbRunEval = 5, DataSplit = 75, Yweights=NULL, Roc = T, Optimized.Threshold.Roc = T,<br />

&nbsp; Kappa = F, TSS=T, KeepPredIndependent = F, VarImport=5, NbRepPA=2, strategy=&quot;random&quot;,<br />&nbsp; coor=coorXY, nb.absences=1/3(dim(species)[1]))</div> 
  <div> </div> 
  <div># saving Pseudo-Absence data </div> 
  <div>save(Biomod.PA.data, file=paste(Biomod.material$species.names, &quot;PAdata&quot;, sep=&quot;_&quot;))<br />save(Biomod.PA.sample, file=paste(Biomod.material$species.names, &quot;PAsample&quot;, sep=&quot;_&quot;))</div> 
  <div> </div> 
  <div>### PREDICTIONS ################################################################</div> 
  <div>&nbsp; #Predictions on the original dataset <br /> <br />&nbsp; CurrentPred(GLM=T, GBM=T, GAM=T, CTA=F, ANN=T, SRE=F, FDA=T, MARS=F, RF=T,<br />&nbsp; BinRoc=T, BinKappa=F, BinTSS=T, FiltKappa=F)</div> 
  <div>&nbsp; PredictionBestModel(GLM=T,GBM=T, GAM=T, CTA=F, ANN=T, FDA=T, MARS=F, RF=T, SRE=F,<br />&nbsp; method='all', Bin.trans = T, Filt.trans = T)</div> 
  <div> </div> 
  <div># saving evaluation results</div> 
  <div>&nbsp; save(Evaluation.results.TSS,file=paste(&quot;eval.TSS&quot;,&quot;_&quot;,Biomod.material$species.names,sep=&quot;&quot;))<br />&nbsp; save(Evaluation.results.Roc,file=paste(&quot;eval.ROC&quot;,&quot;_&quot;,Biomod.material$species.names,sep=&quot;&quot;))</div> 
  <div><br /># saving VarImportance<br /> <br />&nbsp; save(VarImportance,file=paste(&quot;VarImportance&quot;,&quot;_&quot;,Biomod.material$species.names,sep=&quot;&quot;))</div> 
  <div><br />### CURRENT PROJECTIONS #########################################################</div> 
  <div> <br />&nbsp; Projection(Proj = clim6190[,4:6], Proj.name='CurrentF',<br />&nbsp; GLM = T, GBM = T, GAM = T, CTA = F, ANN = T, SRE = F, q=0.0025, FDA =T, MARS = T,<br />&nbsp; RF = T, BinRoc=T, BinKappa=F, BinTSS=T, FiltRoc=T, FiltKappa=F, FiltTSS=T, repetition.models=T)</div> 
  <div>&nbsp; Ensemble.Forecasting(Proj.name= &quot;CurrentF&quot;, weight.method='TSS', PCA.median=T,<br />&nbsp; binary=T, bin.method='TSS', Test=T, decay=1.6, repetition.models=T, final.model.out=F)</div> 
  <div> </div> 
  <div>### FUTURE PROJECTIONS #########################################################</div> 
  <div>&nbsp; for (d in 1:18)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; future &lt;- read.table(paste(datapath, &quot;/&quot;, clim[d], &quot;_3var.txt&quot;, sep=&quot;&quot;), header=T, sep=&quot;\t&quot;)</div> 
  <div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Projection(Proj = future, Proj.name=paste(clim[d],&quot;F&quot;,sep=&quot;&quot;), GLM = T, GBM = T, GAM = T,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CTA = F, ANN = T, SRE = F, q=0.0025, FDA =T, MARS = T, RF = T,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BinRoc = T, BinKappa = F, BinTSS = T, FiltRoc = T, FiltKappa = F, FiltTSS = T,<br />

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; repetition.models=T)</div> 
  <div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ProjectionBestModel(Proj.name=paste(clim[d],&quot;F&quot;,sep=&quot;&quot;), Bin.trans=T, Filt.trans=T, method='all')</div> 
  <div> </div> 
  <div>### ENSEMBLE FORECASTING (SDMs) ################################################</div> 
  <div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ensemble.Forecasting(Proj.name= paste(clim[d],&quot;F&quot;,sep=&quot;&quot;), weight.method='TSS', PCA.median=T,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; binary=T, bin.method='TSS', Test=T, decay=1.6, repetition.models=T, final.model.out=F)<br />

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</div> 
  <div> </div> 
  <div>### CLEANING UP ################################################################</div> 
  <div><br /># saving workspace </div> 
  <div>save.image(file=paste(sppnames[f],&quot;_workspace.RData&quot;,sep=&quot;&quot;))</div> 
  <div> <br /># remove objects not needed </div> 
  <div>&nbsp; t= c(&quot;path&quot;, &quot;taxapath&quot;, &quot;datapath&quot;, &quot;sppnames&quot;, &quot;varlist&quot;, 
&quot;species&quot;, &quot;clim6190&quot;, &quot;coorXY&quot;, &quot;ModelsH&quot;, &quot;Ensemble.Forecasting&quot;)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 <br />

&nbsp; Rem = ls()<br />&nbsp; rm(list=(Rem[<a target="_blank" href="http://is.na/">is.na</a>(match(Rem, t))]))<br /> <br />&nbsp; }<br />}&nbsp; </div> <br />
  <p>................<br />
Raquel A. Garcia<br />
Integrative Biology and Global Change Group<br />
www.ibiochange.mncn.csic.es<!--end_signature--></p>