Learn R Programming

insight (version 0.18.6)

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
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