Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Use of count() in example in Factors chapter now broken due to change in grouping #610
Referring to the following example in the factors chapter:
To work correctly, this example requires that count() will remove one group_by level, like summarise does. This was true when the book was written, and true as of dplyr 0.5, but is no longer true today, apparently due to tidyverse/dplyr@439e54d and/or related changes.
Could you please update the book and explicitly note that this behavior has changed since earlier versions of dplyr? It confuses students to have an example which doesn't work, and they already find the implicit removal of group_by levels confusing to start with.
The following variant works for me on both current and 0.50 dplyr: