feat: allow arbitrary number of columns in stub#2008
Conversation
|
Hi Rich! this looks promising! Looking forward to helping test the new feature! Just an FYi, as you said this may be a risky move, this PR only has a 43% test coverage. If possible, I think adding a few tests would be worthwhile! edit: apologies. Just saw that you aren’t done yet and haven’t started the testing part oops 😬 |
|
@olivroy this is definitely a big feature and I’ve been taking my time with it since so many things can be broken with this (fixed many small issues so far!). So far I’ve done a lot of manual/visual testing on my own computer. But yeah, there will be some tests submitted soon! Thanks for offering to test this all out! I imagine things will still be rough after this is merged and several follow-up fixes will need to be made before release. |
|
this is great! sorry, accidentally hit the close PR button |


This PR adds functionality for having several columns become part of the stub. It will allow for stubs where there are levels of headers for row labels (much in the same way that spanners can be layered over column labels). Here's an example where three columns are part of the stub:
Since this feature breaks many assumptions in the table-building logic (i.e., a stub only has one column, but two if
gt(.., row_group_as_column = TRUE)) there may some instability during the time when this is merged and when the package is updated in CRAN. Things that need to be done (and checked closely) are:tab_stubhead()works properly with a multi-column stub; documentation should be updatedtab_style()andtab_footnote()works with multi-column stubscells_stub()is updated with acolumns=parameter and works with the above functionstab_row_group()works with multi-column stubsThe above considerations may not all be covered by this PR, but addressed in follow-up PRs. And there may be other bugs discovered during that phase.
Fixes: #601
Fixes: #918
Fixes: #1406
Fixes: #1408