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

Add select_if() to select based on predicate #1880

Merged
merged 2 commits into from
Jun 2, 2016

Conversation

lionel-
Copy link
Member

@lionel- lionel- commented Jun 2, 2016

This function would be analogous to summarise_if() and mutate_if().

One way to distinguish responsibilities between select() and select_if() is that the former operates on metadata such as the column names, while the latter operates on the columns themselves, and thus requires local sources.

So the custom functions suggested in #1229 would belong to select() because they operate on the column names. And more general predicates based on column types (also metadata) compatible with DB sources could be added to select().

Closes #497, closes #1569

This function is analogous to summarise_if() and mutate_if()

Closes tidyverse#497, closes tidyverse#1569
@hadley
Copy link
Member

hadley commented Jun 2, 2016

I think it maybe should mimic mutate_if() and summarise_if() and always return grouped values. (It'll do that now but you'll get a message because of the default select() behaviour)

@codecov-io
Copy link

codecov-io commented Jun 2, 2016

Current coverage is 20.01%

Merging #1880 into master will decrease coverage by <.01%

@@             master      #1880   diff @@
==========================================
  Files           188        188          
  Lines          7425       7431     +6   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits           1487       1487          
- Misses         5938       5944     +6   
  Partials          0          0          

Powered by Codecov. Last updated by 265db7b...824ee09

@lionel-
Copy link
Member Author

lionel- commented Jun 2, 2016

Here you go

@hadley hadley merged commit 6d70cc7 into tidyverse:master Jun 2, 2016
@hadley
Copy link
Member

hadley commented Jun 2, 2016

Thanks!

@lionel- lionel- deleted the select-if branch November 7, 2017 10:29
@lock lock bot locked as resolved and limited conversation to collaborators Jun 7, 2018
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.

Request: select by column type Selecting all numeric columns
3 participants