plot.tidygam.diff | R Documentation |
Plotting methods for tidygam.diff
objects.
## S3 method for class 'tidygam.diff'
plot(x, ..., sig = TRUE, sig_col = "red", sig_alpha = 0.25)
x |
A |
... |
Arguments passed to |
sig |
Shade the interval(s) where the difference smooth does not include 0 (default is |
sig_col |
Colour for the shading (default is |
sig_alpha |
Alpha level for the shading (default is |
A ggplot
object.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.