Closed gavinsimpson closed 8 months ago
I suspect the issue is because there will be 4 smooths here that contain "ti(Sepal.Length,Sepal.Width)"
and I'm not identifying the correct set of smooths for each pair as a result.
For example, the code below works, which is the equivalent model in non-decomposed form:
library("gratia")
library("mgcv")
data("iris")
mod2 <- gam(Petal.Width ~ Species +
te(Sepal.Length, Sepal.Width, by=Species, k=4),
method = "REML",
data = iris)
# this fails
difference_smooths(mod2, smooth = "te(Sepal.Length,Sepal.Width)")