Skip to content

count()/add_count() should preserve input classes #4086

@yutannihilation

Description

@yutannihilation

(Originally reported at #4051 (comment).)

Details ``` r library(dplyr, warn.conflicts = FALSE)

x <- as_tibble(iris)
g <- group_by(x, Species)
class(g) <- c("myclass", class(g))

x %>%
add_tally() %>%
class()
#> [1] "tbl_df" "tbl" "data.frame"

x %>%
add_count() %>%
class()
#> [1] "tbl_df" "tbl" "data.frame"


<sup>Created on 2019-01-07 by the [reprex package](https://reprex.tidyverse.org) (v0.2.1)</sup>
</details>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions