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

Handle differences between group_by() and .by #136

Open
rossellhayes opened this issue Apr 18, 2023 · 0 comments
Open

Handle differences between group_by() and .by #136

rossellhayes opened this issue Apr 18, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@rossellhayes
Copy link
Contributor

When an exercise includes multiple solutions, tblcheck compares .result to the last solution by default. This usually saves evaluation time, because we don’t need to test every solution if they all have the same value.

This can cause a problem with the new .by argument of summarize() introduced in dplyr 1.1.0. When calling summarize() after group_by(), the groups are sorted, but when calling summarize() with the .by argument, they're given in the order that they first appear in the data (like forcats::fct_inorder()) (https://www.tidyverse.org/blog/2023/02/dplyr-1-1-0-per-operation-grouping/#translating-from-group_by).

tblcheck should apply some logic to exercises with multiple solutions where one involves group_by() and one involves .by so that differences in row order don’t cause a problem.

@rossellhayes rossellhayes added the enhancement New feature or request label Apr 18, 2023
@rossellhayes rossellhayes self-assigned this Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant