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

select(.data, 0) #82

Closed
earowang opened this issue Jan 4, 2019 · 1 comment
Closed

select(.data, 0) #82

earowang opened this issue Jan 4, 2019 · 1 comment

Comments

@earowang
Copy link

earowang commented Jan 4, 2019

It's a corner case. Current select(.data, 0) throws an error. But I would expect select(.data, 0) returns a data frame with 0 columns as .data[, 0].

iris[, 0]
#> data frame with 0 columns and 150 rows
dplyr::select(iris, 0)
#> Error in inds_combine(.vars, ind_list): Each argument must yield either positive or negative integers

Maybe the issue is more related to tidyselect::vars_select().

Created on 2019-01-04 by the reprex package (v0.2.1)

@krlmlr
Copy link
Member

krlmlr commented Jan 4, 2019

Thanks. Underlying issue:

tidyselect::vars_select(character(), 0)
#> Error in inds_combine(.vars, ind_list): Each argument must yield either positive or negative integers

Created on 2019-01-04 by the reprex package (v0.2.1.9000)

When is this corner case important?

@romainfrancois romainfrancois transferred this issue from tidyverse/dplyr Jan 4, 2019
romainfrancois added a commit that referenced this issue Jan 4, 2019
vars_select() skips all zero vectors. closes #82
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

No branches or pull requests

2 participants