-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
select_ does not allow for spaces in column name, filter_ does not seem to work #1392
Comments
About problem 2, this is user error. You can either use
so you get all the data back. |
For problem one, you want: tmp <- "miles per gallon"
select_(mtcars_tbl, as.name(tmp)) |
Romain, Thank you for catching my error! I guess when I saw that one thing didn't work, I started suspecting the package more than my code. Hadley, Thank you for your solution. This will work in the short term, but is it a long term solution? What is the harm of wrapping everything with "as.name" automatically in the "*_" flavors of the package? Does that make something else crash somewhere else? As I'd mentioned, there are 2 reasons to use the "*_" flavors:
|
It's a fundamental choice - should |
Hi Hadley, OK, understood! So there are unfortunately inevitable conflicts in how names are interpreted. I understand that, as it has been the bane of R for many years. I guess I was just hoping that with all the marvelous things that dplyr, tidyr, ggplot2, etc. have been able to manage, despite relying upon a language that has made some poor choices under the hood, that maybe you found some cool magical way to resolve this issue, too. Thanks for your response, and all your amazing packages! |
These are two separate issues, but I think they may have the same underlying code affecting them both. First, with
select_
, I cannot use spaces in the name:Same thing if I actually use the variable, as "intended".
So, whether I pass an actual variable with a string in it, as I presume was the original intent, or if I just want a cleaner way to deal with spaces,
select_
still fails.filter_
(and presumably others) also fails:OK, now onto problem 2:
filter_
does not seem to work at all, even when this whitespace is not an issue. For example:versus
I played around with it some more, looking at the
dim()
, etc. It's pretty clear that nothing is happening withfilter_
. 😦The text was updated successfully, but these errors were encountered: