22  gam

Function mgcv::gam() (Wood 2017, v1.9.4) creates a generalized additive model object (gamObject), i.e., an R object of S3 class 'gam'. Listing 22.1 summarizes the S3 methods for the class 'gam' in package mgcv,

Listing 22.1: 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 22 require (see the explanation of the function name conflict in Section 7.4)

library(hyper.gam)
# Loading required package: groupedHyperframe
# Registered S3 method overwritten by 'pROC':
#   method   from            
#   plot.roc spatstat.explore
search path & loadedNamespaces on author’s computer
search()
#  [1] ".GlobalEnv"                "package:hyper.gam"         "package:groupedHyperframe" "package:mgcv"              "package:nlme"              "package:stats"             "package:graphics"         
#  [8] "package:grDevices"         "package:utils"             "package:datasets"          "package:methods"           "Autoloads"                 "package:base"
loadedNamespaces() |> sort.int()
#   [1] "abind"             "base"              "caret"             "class"             "cli"               "cluster"           "codetools"         "compiler"          "data.table"       
#  [10] "datasets"          "deldir"            "digest"            "doParallel"        "dplyr"             "evaluate"          "farver"            "fastmap"           "fastmatrix"       
#  [19] "foreach"           "future"            "future.apply"      "generics"          "geomtextpath"      "GET"               "ggplot2"           "globals"           "glue"             
#  [28] "goftest"           "gower"             "graphics"          "grDevices"         "grid"              "gridExtra"         "groupedHyperframe" "gtable"            "hardhat"          
#  [37] "htmltools"         "htmlwidgets"       "httr"              "hyper.gam"         "ipred"             "iterators"         "jsonlite"          "knitr"             "lattice"          
#  [46] "lava"              "lazyeval"          "lifecycle"         "listenv"           "lubridate"         "magrittr"          "MASS"              "Matrix"            "matrixStats"      
#  [55] "methods"           "mgcv"              "ModelMetrics"      "nlme"              "nnet"              "otel"              "parallel"          "parallelly"        "patchwork"        
#  [64] "pillar"            "pkgconfig"         "plotly"            "plyr"              "polyclip"          "pracma"            "pROC"              "prodlim"           "purrr"            
#  [73] "R6"                "RColorBrewer"      "Rcpp"              "recipes"           "reshape2"          "rlang"             "rmarkdown"         "rpart"             "rstudioapi"       
#  [82] "S7"                "scales"            "SpatialPack"       "spatstat.data"     "spatstat.explore"  "spatstat.geom"     "spatstat.random"   "spatstat.sparse"   "spatstat.univar"  
#  [91] "spatstat.utils"    "splines"           "stats"             "stats4"            "stringi"           "stringr"           "survival"          "systemfonts"       "tensor"           
# [100] "textshaping"       "tibble"            "tidyr"             "tidyselect"        "timechange"        "timeDate"          "tools"             "utils"             "vctrs"            
# [109] "viridisLite"       "withr"             "xfun"              "yaml"

Table 22.1 summarizes the S3 methods for the class 'gam' in package hyper.gam (v0.2.1.20151215),

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