Skip to content
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

Issue608 #619

Merged
merged 6 commits into from
Jan 19, 2019
Merged

Issue608 #619

merged 6 commits into from
Jan 19, 2019

Conversation

ColinFay
Copy link
Contributor

This PR closes #608 about including the tidyselect semantic into purrr *_at functions

The functions for doing selection in purrr are:

  • lmap_at()
  • map_at()
  • modify_at() & methods

And they can now be used with map_at(my_list, vars(contains("a")), toupper) so to be consistent with the behavior of dplyr::mutate_at().

This implementation first check if the .at is a quosure, if so checks if tidyselect is installed, and if TRUE runs tidyselect::vars_select, otherwise throws an error if the package is not installed (inspired by the way map_df() works).

Copy link
Member

@lionel- lionel- left a comment

Choose a reason for hiding this comment

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

Looks good! Only a few cosmetic changes to make.

R/map.R Outdated Show resolved Hide resolved
R/utils.R Outdated Show resolved Hide resolved
R/map.R Outdated Show resolved Hide resolved
R/utils.R Show resolved Hide resolved
R/utils.R Outdated Show resolved Hide resolved
@ColinFay
Copy link
Contributor Author

@lionel- I made the changes and update the NEWS 👍

@lionel- lionel- merged commit f7e7f54 into tidyverse:master Jan 19, 2019
@lionel-
Copy link
Member

lionel- commented Jan 19, 2019

Awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use tidyselect in map_at
2 participants