powered by
Plotting methods for tidygam.diff objects.
tidygam.diff
# S3 method for tidygam.diff plot(x, ..., sig = TRUE, sig_col = "red", sig_alpha = 0.25)
A ggplot object.
ggplot
A tidygam.diff object (see get_difference()).
get_difference()
Arguments passed to plot().
plot()
Shade the interval(s) where the difference smooth does not include 0 (default is TRUE).
TRUE
Colour for the shading (default is "red").
"red"
Alpha level for the shading (default is 0.25)
0.25
library(mgcv) set.seed(10) data <- gamSim(4) model <- gam(y ~ s(x2, by = fac) + s(x0), data = data) model_diff <- get_difference(model, "x2", list(fac = c("1", "2"))) plot(model_diff)
Run the code above in your browser using DataLab