我创建了一个克里金图,它是使用克里金包的 kriging() 和 image() 函数创建的(表格是带有坐标和值的数据):
krig <- kriging(table@coords[ ,1], table@coords[ ,2], response = table@data$Joined.l_8, model = "spherical", lags = 3, pixels = 100)
krig_raster <- image(krig, main = NULL, xlab = "X coords", ylab = "", col = heat.colors(100))
结果可以在附图中查看。
我的问题是我无法将此地图导出为栅格。使用光栅包的以下命令时:
writeRaster(krig_raster, "/home/stathis/Desktop/test.tif", format="Gtiff", overwrite = TRUE)
我收到以下错误:
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘writeRaster’ for signature ‘"NULL", "character"’