Skip to content

Commit

Permalink
Fixed influence and cooks.distance methods
Browse files Browse the repository at this point in the history
  • Loading branch information
tripartio committed Oct 4, 2024
1 parent 24ee91e commit 6bb6c7d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
28 changes: 16 additions & 12 deletions R/autogam.R
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,15 @@ coef.autogam <- function(x, ...) {
}


#' #' @rdname generic-method
#' #' @export
#' #' @method cooks.distance autogam
#' cooks.distance.autogam <- function(model, ...) {
#' mgcv:::cooks.distance.gam(model$gam, ...)
#' }
#' @rdname generic-method
# # I don't know why CHECK bugs out if this method is exported; it works otherwise
# @export
#' @method cooks.distance autogam
cooks.distance.autogam <- function(model, ...) {
stats::cooks.distance(model$gam, ...)
# For some reason this only works when called from stats, not mgcv
# mgcv:::cooks.distance.gam(model$gam, ...)
}


#' @rdname generic-method
Expand All @@ -183,12 +186,13 @@ formula.autogam <- function(x, ...) {
}


#' #' @rdname generic-method
#' #' @export
#' #' @method influence autogam
#' influence.autogam <- function(model, ...) {
#' mgcv::influence.gam(model$gam, ...)
#' }
#' @rdname generic-method
# # I don't know why CHECK bugs out if this method is exported; it works otherwise
# @export
#' @method influence autogam
influence.autogam <- function(model, ...) {
mgcv::influence.gam(model$gam, ...)
}


#' @rdname generic-method
Expand Down
6 changes: 6 additions & 0 deletions man/generic-method.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6bb6c7d

Please sign in to comment.