View source: R/convenience-plots.R
gg_smooth | R Documentation |
Given a gam model this convenience function returns a plot of all smooth terms contained in the model. If more than one smooth is present, the different smooth are faceted.
gg_smooth(x, ...)
## Default S3 method:
gg_smooth(x, fit, ...)
x |
A data frame or object of class |
... |
Further arguments passed to |
fit |
A model object. |
A ggplot
object.
get_terms
g1 <- mgcv::gam(Sepal.Length ~ s(Sepal.Width) + s(Petal.Length), data=iris)
gg_smooth(iris, g1, terms=c("Sepal.Width", "Petal.Length"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.