I created a kriging map which was created by using the kriging() and image() functions of the kriging package (table is the data with the coords and values):
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))
The result can be viewed in the picture attached.
My problem is that I cannot export this map as a raster. When using the following command of the raster package:
writeRaster(krig_raster, "/home/stathis/Desktop/test.tif", format="Gtiff", overwrite = TRUE)
I get the following error:
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘writeRaster’ for signature ‘"NULL", "character"’