Currently, the user is able to specify the order of the groups in relation to each other using row_group_order(), but there is not a way to specify the order of rows within each group. This would be helpful for ordering rows within groups that have some inherent order to them that may not be obvious to {gt}.
One way would be to make it similar to the factor() function by adding an ordered = option within the tab_row_group():
Thanks for getting this topic from Discussions over into an issue. It's a good one and I like the examples you included here! (A very great thing in a feature request.)
Prework
Proposal
Currently, the user is able to specify the order of the groups in relation to each other using
row_group_order()
, but there is not a way to specify the order of rows within each group. This would be helpful for ordering rows within groups that have some inherent order to them that may not be obvious to {gt}.One way would be to make it similar to the
factor()
function by adding anordered =
option within thetab_row_group()
:Another way would be to add an
order_by =
option which defaults to alphabetic, but can be set as user-specified.