Open mfasiolo opened 5 years ago
It would be nice to be able to do something like:
library(mgcViz) dat <- gamSim(1, n = 700, dist = "normal", scale = 2) b <- gamV(y ~ s(x0) + s(x1, x2) + s(x3), data = dat)
plot(sm(b, 2), newdata = mySpatialObject) + l_fitRaster()
Where mySpatialObject is of class "sf" or "sp", so that we could then be able to use the methods from the ggspatial package.
The basic problem is that mgcv does not understand spatial objects, and mgcViz has the same problem. Not sure how to do this.
It would be nice to be able to do something like:
library(mgcViz) dat <- gamSim(1, n = 700, dist = "normal", scale = 2) b <- gamV(y ~ s(x0) + s(x1, x2) + s(x3), data = dat)
plot(sm(b, 2), newdata = mySpatialObject) + l_fitRaster()
Where mySpatialObject is of class "sf" or "sp", so that we could then be able to use the methods from the ggspatial package.
The basic problem is that mgcv does not understand spatial objects, and mgcViz has the same problem. Not sure how to do this.