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

Deprecate support for filter(, <matrix with 1 column>) #6091

Closed
romainfrancois opened this issue Nov 17, 2021 · 2 comments · Fixed by #6472
Closed

Deprecate support for filter(, <matrix with 1 column>) #6091

romainfrancois opened this issue Nov 17, 2021 · 2 comments · Fixed by #6472
Assignees
Labels
feature a feature request or enhancement lifecycle 🦋 rows ↕️ Operations on rows: filter(), slice(), arrange()
Milestone

Comments

@romainfrancois
Copy link
Member

in #6083 we've let filter() handle matrices of 1 column for the time being. At some point this should warn, and then error.

Packages currently concerned:

@romainfrancois romainfrancois added this to the 1.1.0 milestone Nov 17, 2021
@hadley hadley added feature a feature request or enhancement rows ↕️ Operations on rows: filter(), slice(), arrange() labels Apr 16, 2022
@hadley hadley changed the title warn on filter(, <matrix with 1 column>) Deprecated support for filter(, <matrix with 1 column>) Jul 21, 2022
@hadley hadley changed the title Deprecated support for filter(, <matrix with 1 column>) Deprecate support for filter(, <matrix with 1 column>) Jul 21, 2022
@hadley
Copy link
Member

hadley commented Jul 21, 2022

Minimal reprex:

library(dplyr, warn.conflicts = FALSE)

df <- tibble(x = 1:2, y = matrix(1:2, ncol = 1))
filter(df, y > 1)
#> # A tibble: 1 × 2
#>       x y[,1]
#>   <int> <int>
#> 1     2     2

df <- tibble(x = 1:2, y = matrix(1:2, ncol = 2))
filter(df, y > 1)
#> Error in `filter()`:
#> ! Problem while computing `..1 = y > 1`.
#> ✖ Input `..1` must be a logical vector, not a logical[,2].

Created on 2022-07-21 by the reprex package (v2.0.1)

@hadley
Copy link
Member

hadley commented Aug 18, 2022

Slightly tricky because need to generate deprecation in C: https://github.com/tidyverse/dplyr/blob/main/src/filter.cpp#L67-L73

When fixing, should also update the other deprecations to use lifecycle: https://github.com/tidyverse/dplyr/blob/main/src/filter.cpp#L120-L125.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement lifecycle 🦋 rows ↕️ Operations on rows: filter(), slice(), arrange()
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants