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
Milestone

Comments

@jjchern
Copy link
Contributor

@jjchern 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 label Oct 21, 2015
@hadley hadley added this to the 0.6 milestone Oct 21, 2015
@hadley hadley added this to the 0.5 milestone Oct 21, 2015
@hadley hadley removed this from the 0.6 milestone Oct 21, 2015
@hadley hadley closed this 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants