Skip to content

Conversation

@EmilHvitfeldt
Copy link
Member

to close #1282

it is too much work for us to magically figure out what packages people use in step_mutate() so we ask them to do it

library(recipes)

rec <- recipe(~., data = mtcars) |>
  step_mutate(new = 2)

rec_pred <- rec |>
  prep()

required_pkgs(rec)
#> [1] "recipes"
required_pkgs(rec_pred)
#> [1] "recipes"


rec <- recipe(~., data = mtcars) |>
  step_mutate(new = 2, .pkgs = "stats")

rec_pred <- rec |>
  prep()

required_pkgs(rec)
#> [1] "recipes" "stats"
required_pkgs(rec_pred)
#> [1] "recipes" "stats"

Created on 2024-05-28 with reprex v2.1.0

@EmilHvitfeldt EmilHvitfeldt requested a review from simonpcouch May 28, 2024 21:09
Copy link
Contributor

@simonpcouch simonpcouch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@EmilHvitfeldt EmilHvitfeldt merged commit 130e493 into main May 29, 2024
@EmilHvitfeldt EmilHvitfeldt deleted the required-mutate-pkg branch May 29, 2024 17:07
@github-actions
Copy link
Contributor

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

declare required packages for step_mutate

3 participants