File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -400,12 +400,16 @@ prepare_data <- function(object, new_data) {
400
400
new_data <- .convert_xy_to_form_new(object $ preproc , new_data )
401
401
}
402
402
403
+ encodings <- get_encoding(class(object $ spec )[1 ])
403
404
remove_intercept <-
404
- get_encoding(class(object $ spec )[1 ]) %> %
405
- dplyr :: filter(mode == object $ spec $ mode , engine == object $ spec $ engine ) %> %
406
- dplyr :: pull(remove_intercept )
405
+ vctrs :: vec_slice(
406
+ encodings $ remove_intercept ,
407
+ encodings $ mode == object $ spec $ mode &
408
+ encodings $ engine == object $ spec $ engine
409
+ )
410
+
407
411
if (remove_intercept & any(grepl(" Intercept" , names(new_data )))) {
408
- new_data <- new_data % > % dplyr :: select( - dplyr :: one_of( " (Intercept)" ))
412
+ new_data <- new_data [, colnames( new_data ) != " (Intercept)" , drop = FALSE ]
409
413
}
410
414
411
415
fit_interface <- object $ spec $ method $ fit $ interface
You can’t perform that action at this time.
0 commit comments