It'd be helpful if add_variables() would error when the predictors argument is missing, rather than getting an error later on when, e.g., printing the workflow.
library(workflows)
library(parsnip)
wf <- workflow() %>%
add_variables(outcomes = mpg) %>%
add_model(linear_reg(), formula = mpg ~ .)
wf
#> ══ Workflow ════════════════════════════════════════════════════════════════════
#> Preprocessor: Variables
#> Model: linear_reg()
#>
#> ── Preprocessor ────────────────────────────────────────────────────────────────
#> Error in expr_text(predictors): argument "predictors" is missing, with no default
Created on 2022-03-14 by the reprex package (v2.0.1)
It'd be helpful if
add_variables()would error when thepredictorsargument is missing, rather than getting an error later on when, e.g., printing the workflow.Created on 2022-03-14 by the reprex package (v2.0.1)