I've used INLA before with a SpatialPolygonsDataFrame before, but I have never used it with raster. I have been scouring the internet for many hours, reading vignettes and everything I can find, but still can't figure out how to use INLA with a raster. Below is just a simple example of what my data is like:
library("raster")
library("INLA")
lat = c(10, 10, 10, 10, 14, 14, 14, 14, 10, 10, 10, 10, 14, 14, 14, 14)
lon = c(20 ,24, 28, 32, 20, 24, 28, 32, 20, 24, 28, 32, 20, 24, 28, 32)
response = c(17.3, 17.4, 17.6, 17.9, 17.1, 17.0, 17.4, 17.5, 17.4, 17.4,
17.7, 17.8, 17.2, 17.1, 17.7, 17.9)
explan1 = c(31, 35, 33, 36, 32, 37, 36, 40, 32, 34, 33, 37, 35, 35, 39, 38)
explan2 = c(112, 116, 111, 114, 115, 117, 117, 112, 110, 114, 113, 117, 112,
113, 115, 116)
data.df = data.frame(lat = lat, lon = lon, response = response, explan1 =
explan1, explan2 = explan2)
myGrid = raster(ncol = 5, nrow = 5)
So I throw myself in front of all of you, begging for mercy and help in this manner.