Skip to content

dplyr::n() does not work on databases #197

Closed
@JohnMount

Description

@JohnMount

The dplyr::n() notation suggested in https://github.com/tidyverse/dplyr/blob/master/NEWS.md#breaking-changes does not work on database handles.

packageVersion("dplyr")
#> [1] '0.7.8'

# works
dplyr::summarize(data.frame(x = 1), count = dplyr::n())
#>   count
#> 1     1

# fails
db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:")
t <- dplyr::copy_to(db, data.frame(x = 1), "d")
dplyr::summarize(t, count = dplyr::n())
#> Error: This function should not be called directly

Created on 2018-12-31 by the reprex package (v0.2.1)

See also tidyverse/dplyr#4062 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions