Skip to content

Default behavior of count() seems to have changed in 1.0.0 #5298

@nhols

Description

@nhols

Noticed that the default behavior of count() has changed in 1.0.0 but wasn't listed as a breaking change in the release notes

0.8.5

library(dplyr, warn.conflicts = FALSE)
packageVersion("dplyr")
#> [1] '0.8.5'
tibble(x = 1:3, n = 3:1) %>% count(x)
#> # A tibble: 3 x 2
#>       x     n
#>   <int> <int>
#> 1     1     1
#> 2     2     1
#> 3     3     1

1.0.0

library(dplyr, warn.conflicts = FALSE)
packageVersion("dplyr")
#> [1] '1.0.0'
tibble(x = 1:3, n = 3:1) %>% count(x)
#> Using `n` as weighting variable
#> ℹ Quiet this message with `wt = n` or count rows with `wt = 1`
#> # A tibble: 3 x 2
#>       x     n
#>   <int> <int>
#> 1     1     3
#> 2     2     2
#> 3     3     1

Originally posted by @nhols in #5265 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorverbs 🏃‍♀️

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions