我正在做物种分布建模(生态位模型),我将模型投影到当前或未来的气候栅格(Bioclim 变量)。
当我预测当前栅格(object=bio_stack)时,一切正常,使用以下代码:
#predict species current distribution using bio_stack
current_dist<-predict(object=bio_stack, model=mod_gam,filename="whitebark_current_dist_17April2014",
na.rm=TRUE, type="response", format="GTiff", overwrite=TRUE,
progress="text")
但是,当我预测未来的栅格 ( object=future_bio_stack
) 时,此代码不会产生结果:
#predict species future distribution using future_bio_stack
future_dist<-predict(object = future_bio_stack, model=mod_gam,filename="whitebark_future_dist_17April2014",
fun=predict, na.rm=TRUE, type="response", format="GTiff", overwrite=TRUE,
progress="text")
相反,我收到以下警告消息:
In addition: Warning message:
In predict.gam(model, blockvals, ...) :
not all required variables have been supplied in newdata!
我投影到的未来生物堆栈层在图像中看起来不错,具有正常的最小值和最大值(如果没有信誉分数,我无法发布图像)。
然而,future_bio_stack 的最小值和最大值在摘要中看起来很奇怪,尤其是与 bio_stack 相比。以下是每个堆栈的摘要,并提供了最小值和最大值:
> future_bio_stack
class : RasterStack
dimensions : 4800, 5880, 28224000, 5 (nrow, ncol, ncell, nlayers)
resolution : 0.008333333, 0.008333333 (x, y)
extent : -152, -103, 30, 70 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +ellps=WGS84 +no_defs
names : WC05future_clipped, WC06future_clipped, WC08future_clipped, WC13future_clipped, WC15future_clipped
min values : -32768, -32768, -32768, -32768, -32768
max values : 32767, 32767, 32767, 32767, 32767
> bio_stack
class : RasterStack
dimensions : 4800, 5880, 28224000, 5 (nrow, ncol, ncell, nlayers)
resolution : 0.008333333, 0.008333333 (x, y)
extent : -152, -103, 30, 70 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0
names : WC05_clipped, WC06_clipped, WC08_clipped, WC13_clipped, WC15_clipped
min values : -56, -429, -145, 7, 5
max values : 457, 100, 332, 767, 129
任何想法为什么bio_stack
正在使用该predict
功能但future_bio_stack
不是?