-
Notifications
You must be signed in to change notification settings - Fork 19
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() does not work, n() does #613
Comments
Thanks. I also see: options(conflicts.policy = list(warn = FALSE))
library(dplyr)
iris |>
group_by(Species) |>
summarize(num_observations = count()) |>
collect()
#> Error in `summarize()`:
#> ℹ In argument: `num_observations = count()`.
#> ℹ In group 1: `Species = setosa`.
#> Caused by error in `UseMethod()`:
#> ! no applicable method for 'count' applied to an object of class "NULL" Created on 2025-02-14 with reprex v2.1.1
options(conflicts.policy = list(warn = FALSE))
library(dplyr)
iris |>
duckplyr::as_duckdb_tibble(prudence = "stingy") |>
count(Species) |>
collect()
#> Error in `duckdb_rel_from_df()` at duckplyr/R/duckplyr_df.R:20:5:
#> ! Can't convert columns of class <factor> to relational. Affected
#> column: `Species`. Created on 2025-02-14 with reprex v2.1.1 (Need a better error message here too.) This will work and use DuckDB: options(conflicts.policy = list(warn = FALSE))
library(dplyr)
iris |>
mutate(Species = as.character(Species)) |>
duckplyr::as_duckdb_tibble(prudence = "stingy") |>
count(Species) |>
collect()
#> # A tibble: 3 × 2
#> Species n
#> <chr> <int>
#> 1 setosa 50
#> 2 versicolor 50
#> 3 virginica 50 Created on 2025-02-14 with reprex v2.1.1 |
Better error message with #614. |
Great, thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I found that the following script fails:
Replacing
count()
ton()
makes it work:The text was updated successfully, but these errors were encountered: