Skip to content

Commit

Permalink
fix: correct condition for ignoring y_dists
Browse files Browse the repository at this point in the history
Ignore y_dists if y_dists is NOT a tibble
  • Loading branch information
tripartio committed Feb 24, 2025
1 parent 5050b74 commit bdba29c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions R/autogam.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ autogam <- function(
## Validate arguments -----------------------
# Only directly validate autogam() arguments; mgcv::gam will validate ... arguments


## Populate args for the mgcv::gam call ----------------------
args <- list(...)
y_vals <- data[[y_col]]
Expand Down Expand Up @@ -97,7 +96,7 @@ autogam <- function(
class(ag) <- c('autogam')
attr(ag, 'autogam_version') <- utils::packageVersion('autogam')

if (!is.null(args$family) || inherits(y_dists, 'tbl_df')) {
if (!is.null(args$family) || !inherits(y_dists, 'tbl_df')) {
# if (!is.null(args$family)) {
# The user specified the family to fit
ag$gam <- do.call(gam_fun, args)
Expand Down

0 comments on commit bdba29c

Please sign in to comment.