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

filter() should error for named input #267

Closed
mgirlich opened this issue Jul 2, 2021 · 0 comments · Fixed by #268
Closed

filter() should error for named input #267

mgirlich opened this issue Jul 2, 2021 · 0 comments · Fixed by #268

Comments

@mgirlich
Copy link
Collaborator

mgirlich commented Jul 2, 2021

This dplyr feature is pretty handy against typos 😄

library(dplyr, warn.conflicts = FALSE)
library(dtplyr)

mtcars %>% filter(mpg = 1)
#> Error: Problem with `filter()` input `..1`.
#> x Input `..1` is named.
#> ℹ This usually means that you've used `=` instead of `==`.
#> ℹ Did you mean `mpg == 1`?
lazy_dt(mtcars) %>% filter(mpg = 1)
#> Source: local data table [1 x 11]
#> Call:   `_DT1`[1]
#> 
#>     mpg   cyl  disp    hp  drat    wt  qsec    vs    am  gear  carb
#>   <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1    21     6   160   110   3.9  2.62  16.5     0     1     4     4
#> 
#> # Use as.data.table()/as.data.frame()/as_tibble() to access results

Created on 2021-07-02 by the reprex package (v2.0.0)

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

Successfully merging a pull request may close this issue.

1 participant