Skip to content

recipe() error message with missing data argument #1042

@simonpcouch

Description

@simonpcouch

recipes:::recipe.formula called without a data argument gives a base missing argument error from an internal function:

library(tidymodels)

recipe(mpg ~ .)
#> Error in form2args(formula, data, ...): argument "data" is missing, with no default

Called by itself, this is interpretable enough, though it took me a few moments to diagnose when situated amongst other tidymodels code, which could feasibly also be passing formulas around:

tune_bayes(
  linear_reg(engine = "glmnet", penalty = tune(), mixture = tune()),
  recipe(mpg ~ .) %>% step_ns(hp, deg_free = tune()),
  bootstraps(mtcars, 2)
)
#> Error in form2args(formula, data, ...): argument "data" is missing, with no default

Created on 2022-09-30 by the reprex package (v2.0.1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    upkeepmaintenance, infrastructure, and similar

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions