Rework of summary_factorlist() to reduce code duplication #14
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.
I was looking at the source for
summary_factorlist
this week to see how easy it would be to add a feature to it, and noticed there was a bit of code duplication withsummary_factorlist1
,summary_factorlist2
, etc. This PR is an attempt to rewrite some of that implementation with code that is (hopefully) cleaner and more maintainable. Obviously it usesdplyr
/tidyr
heavily but they were already imports for this package so hopefully that's OK.The PR may not be ready to merge just yet, I just wanted to see if you would be open to this kind of change. Happy to address any issues you may have.
I've checked to make sure all tests and CRAN checks pass with the reworked code, and have done some additional testing to make sure the output is the same before and after.