as_flextable.gam: Transform a 'gam' model into a flextable

View source: R/as_flextable_gam.R

as_flextable.gamR Documentation

Transform a 'gam' model into a flextable

Description

produce a flextable describing a generalized additive model produced by function mgcv::gam. as_flextable.gam illustration

Usage

## S3 method for class 'gam'
as_flextable(x, ...)

Arguments

x

gam model

...

unused argument

See Also

Other as_flextable methods: as_flextable(), as_flextable.data.frame(), as_flextable.glm(), as_flextable.grouped_data(), as_flextable.htest(), as_flextable.kmeans(), as_flextable.lm(), as_flextable.merMod(), as_flextable.pam(), as_flextable.summarizor(), as_flextable.table(), as_flextable.tabular(), as_flextable.tabulator(), as_flextable.xtable()

Examples

if (require("mgcv")) {
  set.seed(2)

  # Simulated data
  dat <- gamSim(1, n = 400, dist = "normal", scale = 2)

  # basic GAM model
  b <- gam(y ~ s(x0) + s(x1) + s(x2) + s(x3), data = dat)

  ft <- as_flextable(b)
  ft
}

flextable documentation built on Oct. 30, 2024, 9:15 a.m.