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

summarise_at and summarise_all stopped working with list when using a DBI connection #4400

Closed
mwillumz opened this issue May 31, 2019 · 2 comments

Comments

@mwillumz
Copy link

I believe the issue is with DBI. I'm having the same problem w/ postgres.

library(dplyr)
packageVersion("dplyr")
packageVersion("DBI")
con <- DBI::dbConnect(RSQLite::SQLite(), dbname = ":memory:")

copy_to(con, iris, "iris",
        temporary = FALSE)

by_species <- tbl(con, "iris") %>%
  group_by(Species)

by_species %>%
  summarise_all(list(min_custom = min, max_custom = max))

# Source:   lazy query [?? x 9]
# Database: sqlite 3.22.0 [:memory:]
  Species Sepal.Length_mi~ Sepal.Width_min~ Petal.Length_mi~ Petal.Width_min~ Sepal.Length_ma~
  <chr>              <dbl>            <dbl>            <dbl>            <dbl>            <dbl>
1 setosa               4.3              2.3              1                0.1              5.8
2 versic~              4.9              2                3                1                7  
3 virgin~              4.9              2.2              4.5              1.4              7.9
# ... with 3 more variables: Sepal.Width_max_custom <dbl>, Petal.Length_max_custom <dbl>,
#   Petal.Width_max_custom <dbl>

by_species %>%
  summarise_all(list(min_custom = ~ min(., na.rm = TRUE), max_custom = ~ max(., na.rm = TRUE)))
 
Error in as.pairlist(list(...)) : object 'Sepal.Length' not found

by_species %>%
  summarise_at(vars(Sepal.Length), list(min_custom = ~ min(., na.rm = TRUE), max_custom = ~ max(., na.rm = TRUE)))

Error in as.pairlist(list(...)) : object 'Sepal.Length' not found

Originally posted by @mwillumz in #4379 (comment)

@romainfrancois
Copy link
Member

duplicate of #4393

@lock
Copy link

lock bot commented Nov 30, 2019

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Nov 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants