我无法从kri的预测值中提取“ var1.pred”,“ var1.var”,它们都显示为NA。
data=read.csv('D:/R/R程序/2016.12.31/对比气温数据/2016年均温.csv')
bound=readOGR('F:/ArcGis/RACGIS数据库/江苏省行政区/泰州.shp')
dsp <- SpatialPoints(rev(data[,1:2]), proj4string=CRS("+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"))
dsp <- SpatialPointsDataFrame(dsp,data)
WGS84<- CRS("+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0")
dsp1<-spTransform(dsp,WGS84)
bound1<-spTransform(bound,WGS84)
blank_raster<-raster(nrow=150,ncol=150,extent(bound))
values(blank_raster)<-1
bound_raster<-rasterize(bound,blank_raster)
plot(bound_raster)
v=variogram(value~1,dsp)
m=fit.variogram(v,vgm(0.13,'Gau',150,2.2))
plot(v,m)
Grid<-as(bound_raster,"SpatialGridDataFrame")
kri<-krige(formula=value~1,model=m,locations=dsp,newdata=Grid,nmax=12, nmin=10)
spplot(kri['var1.var'],col.regions =rev(heat.colors(16)),do.log = TRUE,scales=list(draw = TRUE),main=list(label="克里金标准差",cex=1.2,fontfamily="song"))
我可以使用spplot绘制kri的热图,但无法提取kri中的预测值,例如“ var1.pred”,“ var1.var”,它们都显示为NA。 [https://pan.baidu.com/s/12IF2ZNWf4a9-idZpw2jYWw]提取码:3kch
head(kri)
var1.pred var1.var
1 NA NA
2 NA NA
3 NA NA
4 NA NA
5 NA NA
6 NA NA