Learn R Programming

insight (version 0.20.4)

is_gam_model: Checks if a model is a generalized additive model

Description

Small helper that checks if a model is a generalized additive model.

Usage

is_gam_model(x)

Value

A logical, TRUE if x is a generalized additive model and has smooth-terms

Arguments

x

A model object.

Examples

Run this code
data(iris)
model1 <- lm(Petal.Length ~ Petal.Width + Sepal.Length, data = iris)
model2 <- mgcv::gam(Petal.Length ~ Petal.Width + s(Sepal.Length), data = iris)
is_gam_model(model1)
is_gam_model(model2)

Run the code above in your browser using DataLab