Skip to content

Commit

Permalink
Amend paul-buerkner#1459: check_response = TRUE has no effect if `r…
Browse files Browse the repository at this point in the history
…eq_vars = character()`

Thus, we need to set `req_vars` to the response variable.
  • Loading branch information
fweber144 committed Feb 15, 2023
1 parent c793d9f commit 44f4283
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/projpred.R
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ get_refmodel.brmsfit <- function(object, newdata = NULL, resp = NULL,
if (extract_y) {
data <- current_data(
object, newdata, resp = resp, check_response = TRUE,
allow_new_levels = TRUE, req_vars = character()
allow_new_levels = TRUE, req_vars = all.vars(bterms$respform)
)
y <- model.response(model.frame(bterms$respform, data, na.action = na.pass))
y <- unname(y)
Expand Down

0 comments on commit 44f4283

Please sign in to comment.