Refactor resolver to nudge to adding row names to columns + improve error message + refactor tests #1770
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
In short the stub created when rownames are not present prevents us from using row names.
I noticed that a way to find out this is to notice that all items are NA, it means they don't exist.
Instead of showing which row names couldn't be resolved, nudge towards adding row names to the gt table instead.
I also took advantage of this PR to remove a duplicate test in test-tab_style.R and merge the tests for output + deprecated arguments.
I have to say that I didn't know the existence of
tab_row_group()
before. I think this function should be deprecated in favour of acase_match()
syntax.Honestly, I would have had trouble finding
tab_options(row_group.default_label)
without trying theothers_label
first and getting the nudge there. (It is documented, but still feels like not the best design). Oh, this is #729!Related GitHub Issues and PRs
fix #1535
Checklist
testthat
unit tests totests/testthat
for any new functionality.