Skip to content

Commit

Permalink
Corrections of S3 methods from CHECK
Browse files Browse the repository at this point in the history
  • Loading branch information
tripartio committed Oct 4, 2024
1 parent 88be37e commit 24ee91e
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 32 deletions.
2 changes: 2 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
Imports:
ale,
cli,
dplyr,
mgcv,
purrr,
rlang,
staccuracy,
stats,
stringr
Expand Down
3 changes: 1 addition & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Generated by roxygen2: do not edit by hand

S3method(anova,autogam)
S3method(cooks.distance,autogam)
S3method(coef,autogam)
S3method(formula,autogam)
S3method(influence,autogam)
S3method(logLik,autogam)
S3method(model.matrix,autogam)
S3method(plot,autogam)
Expand Down
52 changes: 30 additions & 22 deletions R/autogam.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ autogam <- function(
#'
print.autogam <- function(x, ...) {
# Call mgcv:::print.gam
mgcv:::print.gam(x$gam, ...)
mgcv::print.gam(x$gam, ...)

# Print basic performance measures
if (x$params$y_type == 'numeric') {
Expand Down Expand Up @@ -117,22 +117,22 @@ print.autogam <- function(x, ...) {
#' @method plot autogam
#'
plot.autogam <- function(x, ...) {
mgcv:::plot.gam(x$gam, ...)
mgcv::plot.gam(x$gam, ...)
}


#' Summary Method for autogam Objects
#'
#' This function returns a summary of an `autogam` object. It calls the `mgcv::gam` object [mgcv::summary.gam()] method.
#'
#' @param x An object of class \code{autogam}.
#' @param object An object of class \code{autogam}.
#' @param ... Additional arguments passed to other methods.
#' @return Same return object as [mgcv::summary.gam()].
#' @export
#' @method summary autogam
#'
summary.autogam <- function(x, ...) {
mgcv:::summary.gam(x$gam, ...)
summary.autogam <- function(object, ...) {
mgcv::summary.gam(object$gam, ...)
}


Expand All @@ -148,77 +148,85 @@ summary.autogam <- function(x, ...) {
#' @name autogam generic methods
#' @rdname generic-method
#'
#' @param x An object of class \code{autogam}.
#' @param x,model An object of class \code{autogam}.
#' @param ... Additional arguments passed to other methods.
#' @return Returns the return object of the corresponding `mgcv::gam` method.
#' @export
#' @method anova autogam
#'
anova.autogam <- function(x, ...) {
mgcv:::anova.gam(x$gam, ...)
mgcv::anova.gam(x$gam, ...)
}


#' @rdname generic-method
#' @export
#' @method cooks.distance autogam
cooks.distance.autogam <- function(x, ...) {
mgcv:::cooks.distance.gam(x$gam, ...)
#' @method coef autogam
coef.autogam <- function(x, ...) {
stats::coef(x$gam, ...)
}


#' #' @rdname generic-method
#' #' @export
#' #' @method cooks.distance autogam
#' cooks.distance.autogam <- function(model, ...) {
#' mgcv:::cooks.distance.gam(model$gam, ...)
#' }


#' @rdname generic-method
#' @export
#' @method formula autogam
formula.autogam <- function(x, ...) {
mgcv:::formula.gam(x$gam, ...)
mgcv::formula.gam(x$gam, ...)
}


#' @rdname generic-method
#' @export
#' @method influence autogam
influence.autogam <- function(x, ...) {
mgcv:::influence.gam(x$gam, ...)
}
#' #' @rdname generic-method
#' #' @export
#' #' @method influence autogam
#' influence.autogam <- function(model, ...) {
#' mgcv::influence.gam(model$gam, ...)
#' }


#' @rdname generic-method
#' @export
#' @method logLik autogam
logLik.autogam <- function(x, ...) {
mgcv:::logLik.gam(x$gam, ...)
mgcv::logLik.gam(x$gam, ...)
}


#' @rdname generic-method
#' @export
#' @method model.matrix autogam
model.matrix.autogam <- function(x, ...) {
mgcv:::model.matrix.gam(x$gam, ...)
mgcv::model.matrix.gam(x$gam, ...)
}


#' @rdname generic-method
#' @export
#' @method predict autogam
predict.autogam <- function(x, ...) {
mgcv:::predict.gam(x$gam, ...)
mgcv::predict.gam(x$gam, ...)
}


#' @rdname generic-method
#' @export
#' @method residuals autogam
residuals.autogam <- function(x, ...) {
mgcv:::residuals.gam(x$gam, ...)
mgcv::residuals.gam(x$gam, ...)
}


#' @rdname generic-method
#' @export
#' @method vcov autogam
vcov.autogam <- function(x, ...) {
mgcv:::vcov.gam(x$gam, ...)
mgcv::vcov.gam(x$gam, ...)
}

9 changes: 3 additions & 6 deletions man/generic-method.Rd

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

4 changes: 2 additions & 2 deletions man/summary.autogam.Rd

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

0 comments on commit 24ee91e

Please sign in to comment.