Learn R Programming

insight (version 0.16.0)

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)

Arguments

x

A model object.

Value

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

Examples

Run this code
# NOT RUN {
if (require("mgcv")) {
  data(iris)
  model1 <- lm(Petal.Length ~ Petal.Width + Sepal.Length, data = iris)
  model2 <- 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