Skip to content

Commit

Permalink
don't try this for spark
Browse files Browse the repository at this point in the history
  • Loading branch information
hfrick committed Dec 8, 2023
1 parent 0372970 commit 2b85412
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions R/fit_helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
form_form <-
function(object, control, env, ...) {

encoding_info <-
get_encoding(class(object)[1]) %>%
dplyr::filter(mode == object$mode, engine == object$engine)

remove_intercept <- encoding_info %>% dplyr::pull(remove_intercept)
if (remove_intercept) {
env$data <- env$data[, colnames(env$data) != "(Intercept)", drop = FALSE]
}

if (inherits(env$data, "data.frame")) {
check_outcome(eval_tidy(rlang::f_lhs(env$formula), env$data), object)

encoding_info <-
get_encoding(class(object)[1]) %>%
dplyr::filter(mode == object$mode, engine == object$engine)

remove_intercept <- encoding_info %>% dplyr::pull(remove_intercept)
if (remove_intercept) {
env$data <- env$data[, colnames(env$data) != "(Intercept)", drop = FALSE]
}
}

# prob rewrite this as simple subset/levels
Expand Down

0 comments on commit 2b85412

Please sign in to comment.