Skip to content

Commit

Permalink
Fix to checks on formula variables
Browse files Browse the repository at this point in the history
  • Loading branch information
alexiosg committed May 25, 2023
1 parent 5d6d41b commit 477ee66
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/mgcv-model.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ gam_modelspec <- function(formula, data, family = gaussian(link = "identity"), .
}
data_vars <- colnames(data)
data <- data[,c(response_var,formula_vars)]
check <- formula_vars %in% colnames(data)
if (!check) stop("\ndata variables do not match formula variables/")
check <- all(formula_vars %in% colnames(data))
if (!check) stop("\ndata variables do not match formula variables.")
time_zone <- tzone(index(data))
spec <- list()
spec$formula <- formula
Expand Down

0 comments on commit 477ee66

Please sign in to comment.