17  gam

Function mgcv::gam() creates a generalized additive model object (gamObject), i.e., an R object of S3 class 'gam'.

Listing 17.1 summarizes the S3 methods for the class 'gam' in package mgcv,

Listing 17.1: Existing S3 methods mgcv::*.gam
Code
suppressPackageStartupMessages(library(mgcv))
.S3methods(class = 'gam', all.names = TRUE) |> 
  attr(which = 'info', exact = TRUE) |>
  subset.data.frame(subset = (from %in% c('mgcv', 'registered S3method')))
#                    visible                from        generic  isS4
# anova.gam             TRUE                mgcv          anova FALSE
# cooks.distance.gam   FALSE registered S3method cooks.distance FALSE
# formula.gam           TRUE                mgcv        formula FALSE
# influence.gam         TRUE                mgcv      influence FALSE
# logLik.gam            TRUE                mgcv         logLik FALSE
# model.matrix.gam      TRUE                mgcv   model.matrix FALSE
# plot.gam              TRUE                mgcv           plot FALSE
# predict.gam           TRUE                mgcv        predict FALSE
# print.gam             TRUE                mgcv          print FALSE
# residuals.gam         TRUE                mgcv      residuals FALSE
# summary.gam           TRUE                mgcv        summary FALSE
# vcov.gam              TRUE                mgcv           vcov FALSE

The examples in Chapter 17 require that the search path contains the following namespaces. See the explanation of the function name conflict in Section 7.3.5.

library(groupedHyperframe)
library(hyper.gam)
# Registered S3 method overwritten by 'pROC':
#   method   from            
#   plot.roc spatstat.explore

Package hyper.gam (v0.2.1.20151031) implements more S3 methods to the class 'gam' (Table 17.1),

Table 17.1: S3 methods hyper.gam::*.gam (v0.2.1.20151031)
visible from generic isS4
getData.gam TRUE hyper.gam nlme::getData FALSE