Is it possible to use the predict or gstat function in the gstat package to do universal block kriging with SpatialPolygons where the universal kriging covariates are spatial coordinates? The relevant covariates must be available for any point within the SpatialPolygon, which effectively limits to covariates to being the spatial coordinates. Even with the restriction of coordinate-based covariates, I can't get this to work for *universal* kriging (it works fine for ordinary kriging).
The example below illustrates the problem using a reproducible example. I think the issue is that the coordinates within each Polygons object inside the SpatialPolygons object do not having coordinate names matching those of the observed data set. However, I can't seem to figure out a way to give them the desired name. Is there a simple way to overcome this problem? I do have a hack to get the predictions I need, but it certainly feels like there is a simpler approach that eludes me.
coordinates(meuse) = ~x+y
g = gstat(formula = log(zinc) ~ x + y, data = meuse, model = vgm(1, "Sph", 300, 1))
gridded(meuse.grid) = ~x+y
# typical prediction on a grid (no problem)
p = predict(g, newdata = meuse.grid)