Skip to content

Commit

Permalink
adding errors for tibble
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Thorson committed Aug 20, 2024
1 parent 2377cf9 commit 8f51512
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions R/predict.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ function( object,

# extract original X and Z
if(missing(newdata)) newdata = object$data
assertDataFrame(newdata)
if(inherits(newdata,"tbl")) stop("`data` must be a data.frame and cannot be a tibble")
what = match.arg(what)

# Build new
Expand Down Expand Up @@ -328,6 +330,7 @@ function( object,

tmb_data = object$tmb_inputs$tmb_data
origdata = object$data
if(inherits(newdata,"tbl")) stop("`data` must be a data.frame and cannot be a tibble")

# Check newdata for missing variables and/or factors
pred_set = unique(unlist(sapply( object$internal[c('gam_setup','delta_gam_setup')],
Expand Down

0 comments on commit 8f51512

Please sign in to comment.