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

Better error message for the one_of selector #1407

Closed
jjchern opened this issue Sep 12, 2015 · 0 comments
Closed

Better error message for the one_of selector #1407

jjchern opened this issue Sep 12, 2015 · 0 comments
Labels
feature a feature request or enhancement
Milestone

Comments

@jjchern
Copy link
Contributor

jjchern commented Sep 12, 2015

Example:

library(dplyr)
df = data_frame(a = 1, b = 2)

varlist1 = c("c")
select(df, one_of(varlist1))

varlist2 = c("a", "c")
select(df, one_of(varlist2))

The first selection returns the whole data frame, but I expect seeing an error or message indicating that there's no variable called c.

The second selection returns an error:

Error: Each argument must yield either positive or negative integers

This error message is not quite clear to me. It would be great if the second selection yields column a with a warning saying that c can not be found.

@hadley hadley added the feature a feature request or enhancement label Oct 21, 2015
@hadley hadley modified the milestones: 0.6, 0.5 Oct 21, 2015
@hadley hadley closed this as completed in 1e4a97d Mar 7, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Jun 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants