我之前曾将 INLA 与 SpatialPolygonsDataFrame 一起使用过,但我从未将它与光栅一起使用过。我已经在互联网上搜索了好几个小时,阅读了小插图和我能找到的所有内容,但仍然无法弄清楚如何将 INLA 与光栅一起使用。下面只是我的数据的一个简单示例:
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)
于是,我就站在你们面前,以这种方式乞求怜悯和帮助。