Skip to content
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

Modify header updates #719

Merged
merged 13 commits into from
Dec 23, 2020
Merged

Modify header updates #719

merged 13 commits into from
Dec 23, 2020

Conversation

ddsjoberg
Copy link
Owner

@ddsjoberg ddsjoberg commented Dec 19, 2020

What changes are proposed in this pull request?

  1. The internals of modify_header() have been updated so users may more easily access internal data while defining headers. For example, whenever a user updates the header of tbl_summary(by=) column, they will have access to the level, and the Ns within that level. Previously, they needed to use a stat_by= argument that did not fit well with the structure of a general gtsummary object. There is no longer a need to call this function: the users will simply have access to these values via teh glue syntax when defining the header. Moreover, these counts are now available for tbl_svysummary() objects including the unweighted counts.
  2. Internally, the modify_header_internal() function has been removed and simply replaced with modify_header().
  3. The modify_header() function no longer adds its call to the gtsummary .$call_list. The call list is used to more easily re-construct the series of gtsummary calls if needed. However, the column headers can easily be re-constructed from the .$table_header object.

closes #668


Checklist for PR reviewer

  • PR branch has pulled the most recent updates from master branch. Ensure the pull request branch and your local version match and both have the latest updates from the master branch.
  • If an update was made to tbl_summary(), was the same change implemented for tbl_svysummary()?
  • If a new function was added, function included in _pkgdown.yml
  • If a bug was fixed, a unit test was added for the bug check
  • Run pkgdown::build_site(). Check the R console for errors, and review the rendered website.
  • Code coverage is suitable for any new functions/features. Review coverage with covr::report(). Before you run, set Sys.setenv(NOT_CRAN="true") and begin in a fresh R session without any packages loaded.
  • R CMD Check runs without errors, warnings, and notes
  • usethis::use_spell_check() runs with no spelling errors in documentation

When the branch is ready to be merged into master:

  • Update 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 parantheses at the end update (see NEWS.md for examples).
  • Increment the version number using usethis::use_version(which = "dev")
  • Run codemetar::write_codemeta()
  • Run usethis::use_spell_check() again
  • Approve Pull Request
  • Merge the PR. Please use "Squash and merge".

@ddsjoberg ddsjoberg marked this pull request as ready for review December 23, 2020 16:18
@ddsjoberg ddsjoberg requested a review from jalavery December 23, 2020 17:48
@jalavery jalavery merged commit f704ff1 into master Dec 23, 2020
@jalavery jalavery deleted the modify_header_udpates branch December 23, 2020 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Give modify_header() access to unweighted Ns after tbl_svysummary()
2 participants