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

count not working #159

Closed
ds-jim opened this issue Jun 5, 2020 · 4 comments
Closed

count not working #159

ds-jim opened this issue Jun 5, 2020 · 4 comments
Labels
bug an unexpected problem or unintended behavior dplyr-compat 💞 dplyr compatibility issues

Comments

@ds-jim
Copy link

ds-jim commented Jun 5, 2020

Count doesn't seem to work , I'm using R 4.0 and dtplyr 1.0.1.9000

Borrowed the repex that was shown to work from issue 97 #97

suppressPackageStartupMessages(library(dplyr))
library(dtplyr)

mtcars %>%  
  group_by(vs) %>% 
  count(am)
#> # A tibble: 4 x 3
#> # Groups:   vs [2]
#>      vs    am     n
#>   <dbl> <dbl> <int>
#> 1     0     0    12
#> 2     0     1     6
#> 3     1     0     7
#> 4     1     1     7

mtcars %>%  
  lazy_dt() %>% 
  group_by(vs) %>% 
  count(am)
#> Source: local data table [?? x 4]
#> Call:   copy(`_DT1`)[, `:=`(.add = TRUE), keyby = .(vs)][, .(n = .N), 
#>     keyby = .(am, .add, .drop)]
#> Error in eval(bysub, x, parent.frame()): object '.drop' not found

Created on 2020-06-05 by the reprex package (v0.3.0)

@GitHunter0
Copy link

I'm having the same issue

@fmannhardt
Copy link

Same issue here.

@hadley hadley added bug an unexpected problem or unintended behavior dplyr-compat 💞 dplyr compatibility issues labels Jan 25, 2021
@hadley
Copy link
Member

hadley commented Jan 25, 2021

I see a different problem:

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

dt <- lazy_dt(data.frame(x = c(1, 1, 2)))

dt %>% count(x)
#> Error in UseMethod("count"): no applicable method for 'count' applied to an object of class "c('dtplyr_step_first', 'dtplyr_step')"

Created on 2021-01-25 by the reprex package (v0.3.0.9001)

@ds-jim
Copy link
Author

ds-jim commented Jan 26, 2021

I've updated to the latest development dtplyr and can confirm that I get the exact same error as your reprex now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior dplyr-compat 💞 dplyr compatibility issues
Projects
None yet
Development

No branches or pull requests

4 participants