-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Big footnote updates #2083
Big footnote updates #2083
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks amazing! Thanks @ddsjoberg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love it!! Less overlapping/cluttered and much easier to understand what each function is meant to do. Very nice that you can add new footnotes without replacing the old ones :)
What changes are proposed in this pull request?
Updates to the handling of footnotes. Previously, header footnotes were handled with
modify_footnote()
andmodify_table_styling(footnote)
. It was possible to also include footnotes in the table body withmodify_table_styling(footnote)
, but this was largely a hidden feature. Also confusingly, a special abbreviation footnote was handled withmodify_footnote(abbreviation=TRUE)
.In this update, we now export separate user-facing functions for each of these with clearer names and scope:
modify_footnote_header()
,modify_footnote_body()
, andmodify_abbreviation()
. As the names indicate, themodify_footnote_header()
andmodify_footnote_body()
functions place footnotes in the header and table body. Abbreviations are now treated like source notes and do not have footnote markers associated with them. We also export functionsremove_footnote_header()
,remove_footnote_body()
, andremove_abbreviation()
to remove previously assigned footnotes and abbreviations.Also, multiple footnotes may now reference the same cell in the table or column header by utilizing the
modify_footnote_header(replace=FALSE)
,modify_footnote_body(replace=FALSE)
argument.Previously, source notes were an undocumented feature and only a single source note could be included in a table. We now export
modify_source_note()
andremove_source_note()
to add and remove any number of source notes. Also, when merging and stacking tables, previously due to the one source note limit, only the first source note was retained. Now all source notes will be included below the resulting table. This is different behavior compared to previous versions of the package and in rare cases may result in a different source note. Moreover,kableExtra
output now supports source notes, where previously they were omitted.If there is an GitHub issue associated with this pull request, please provide link.
closes #1675
Reviewer Checklist (if item does not apply, mark is as complete)
pkgdown::build_site()
. Check the R console for errors, and review the rendered website.devtools::test_coverage()
usethis::use_spell_check()
runs with no spelling errors in documentationWhen the branch is ready to be merged into master:
NEWS.md
with the changes from this pull request under the heading "# gtsummary (development version)
". If there is an issue associated with the pull request, reference it in parentheses at the end update (seeNEWS.md
for examples).usethis::use_version(which = "dev")
usethis::use_spell_check()
again