gg_smooth: Plot smooth 1d terms of gam objects

View source: R/convenience-plots.R

gg_smoothR Documentation

Plot smooth 1d terms of gam objects

Description

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.

Usage

gg_smooth(x, ...)

## Default S3 method:
gg_smooth(x, fit, ...)

Arguments

x

A data frame or object of class ped.

...

Further arguments passed to get_terms

fit

A model object.

Value

A ggplot object.

See Also

get_terms

Examples

g1 <- mgcv::gam(Sepal.Length ~ s(Sepal.Width) + s(Petal.Length), data=iris)
gg_smooth(iris, g1, terms=c("Sepal.Width", "Petal.Length"))

pammtools documentation built on July 26, 2023, 6:07 p.m.