We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 31506c7 commit 0e37996Copy full SHA for 0e37996
R/fit.R
@@ -137,6 +137,16 @@ fit.model_spec <-
137
cli::cli_abort(msg)
138
}
139
140
+ if (is_sparse_matrix(data)) {
141
+ outcome_names <- all.names(rlang::f_lhs(formula))
142
+ outcome_ind <- match(outcome_names, colnames(data))
143
+
144
+ y <- data[, outcome_ind]
145
+ x <- data[, -outcome_ind, drop = TRUE]
146
147
+ return(fit_xy(object, x, y, case_weights, control, ...))
148
+ }
149
150
dots <- quos(...)
151
152
if (length(possible_engines(object)) == 0) {
@@ -174,16 +184,6 @@ fit.model_spec <-
174
184
eval_env$formula <- formula
175
185
eval_env$weights <- wts
176
186
177
- if (is_sparse_matrix(data)) {
178
- outcome_names <- all.names(rlang::f_lhs(formula))
179
- outcome_ind <- match(outcome_names, colnames(data))
180
-
181
- y <- data[, outcome_ind]
182
- x <- data[, -outcome_ind, drop = TRUE]
183
- return(fit_xy(object, x, y, case_weights, control, ...))
- }
187
data <- materialize_sparse_tibble(data, object, "data")
188
189
fit_interface <-
0 commit comments