-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support modern tidyselect #595
Merged
topepo
merged 16 commits into
tidymodels:master
from
DavisVaughan:fix/tidyselect-updates
Nov 8, 2020
Merged
Support modern tidyselect #595
topepo
merged 16 commits into
tidymodels:master
from
DavisVaughan:fix/tidyselect-updates
Nov 8, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Also simplifies them both a bit, and tweaks the output order with skipped steps that skip dropping columns in the test set
DavisVaughan
changed the title
Allow tidyselect
Support modern tidyselect
Nov 4, 2020
&
, |
, !
, and -
in selectors
|
Added an issue to MachineShop brian-j-smith/MachineShop#4 |
This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #572
Don't be alarmed by the number of files changed. Most changes are in
selections.R
,recipe.R
, androles.R
.With this PR, recipes now supports the entire modern tidyselect DSL. This includes:
The ops
&
,|
,!
and-
The new
where()
functionUsing
c()
to specify multiple variables at onceUser created specified selector functions
We still support the recipes specific selector functions
This is supported in all of the
step_*()
functions. Additionally, it is supported inadd_role()
,update_role()
, andremove_role()
. It is also supported inbake()
andjuice()
.Notably,
step_interact()
has gained support forwhere()
, but cannot use the tidyselect ops like&
or|
. Mixing these with the formula syntax is just too weird. I've updated the selection docs to note that it is more restricted.This is accomplished by essentially deprecating
terms_select()
in favor ofeval_select_recipes()
. We no longer useterms_select()
orelement_check()
internally, but since we exportterms_select()
, it has to stick around.In the process of updating
bake()
andjuice()
, I had to do a little rewriting of those functions. One side effect of this is that when you have a skipped step that would have otherwise dropped columns from the test set, the ordering of those columns that didn't get dropped has now changed slightly. It used to be relative to the training set (where the dropping happened), but now it is relative to the original recipe, which I think is more intuitive.These are fairly big changes, so it would be nice to run full revdeps with this branch before merging. It would also be nice to run against extrachecks and maybe the book.