Skip to content

Handle differences between group_by() and .by #136

@rossellhayes

Description

@rossellhayes

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions