R/update.R

Defines functions update.hyper_gam

Documented in update.hyper_gam

#' @title \link[stats]{update} a [hyper_gam] model
#' 
#' @param object a [hyper_gam] model
#' 
#' @param ... additional parameters, currently not in use
#' 
#' @returns 
#' Function [update.hyper_gam()] returns a [hyper_gam] model
#' 
#' @keywords internal
#' @importFrom stats update.default
#' @export update.hyper_gam
#' @export
update.hyper_gam <- function(object, ...) {
  # we do not have any ?mgcv:::update.*
  # 'gam' object is typically c("gam", "glm", "lm")
  # we do not have many ?stats:::update.*
  
  # `update(gam)` invokes ?stats::update.default, as of 2023-12-20 packageDate('mgcv')
  ret <- update.default(object, ...)
  # ret <- NextMethod(generic = 'update') # error
  
  attr(ret, which = 'xname') <- attr(object, which = 'xname', exact = TRUE) # needed by [cor_xy.gam]
  class(ret) <- c('hyper_gam', class(ret))
  return(ret)
}

Try the hyper.gam package in your browser

Any scripts or data that you put into this service are public.

hyper.gam documentation built on June 8, 2025, 10:41 a.m.