-
Notifications
You must be signed in to change notification settings - Fork 2
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
Added add_ess_header()
function
#12
Conversation
Thanks, @ddsjoberg! I added some tests and tweaked the docs a bit. One thing I changed was to label it as ESS. Is there a good way to make an automatic footnote to explain the acronym? |
Yes! In the next release (hoping to go to CRAN in the next 3 weeks or so), there is a new function just for abbreviations. svy <- survey::svydesign(~1, data = nhefs_weights, weights = ~ w_ate)
gtsummary::tbl_svysummary(svy, include = c(age, sex, smokeyrs)) |>
add_ess_header() |>
gtsummary::modify_abbreviation("ESS = Effective Sample Size") We could add a line at the end of the if (grepl(pattern = "ESS", x = header, fixed = TRUE)) {
x <- gtsummary::modify_abbreviation(x, "ESS = Effective Sample Size")
} |
Yaaa! Almost there, just fixing some R CMD Check issues. Incidentally, I have Warning messages:
1: In cards::nest_for_ard(data$variables, by = by, key = "...ard_no_one_will_ever_pick_this...", :
partial argument match of 'rename' to 'rename_columns' I don't think this stems from this change so I thought I'd point it out to you |
Thanks a million, @ddsjoberg! This is awesome |
Ah, yes, thanks for pointing out the partial match. I'll update (someday...) |
PR adds the basics of what you'll need to replace the default headers in
tbl_svysummary()
with ESS-calculated numbers.This does add new dependencies, some of which you could do a little re-writing to remove.
FYI to run the examples in the help file, the user needs survey, gtsummary, cards, and cardx packages, which is why all of them have been added to suggests. I used
gtsummary::trial
data set in the examples, but I am sure you have a more suitable example on hand, so feel free to update.The function still needs unit tests, but I thought you could write them after you confirm I didn't implement the ESS calculation incorrectly 😜
I also ran
usethis::use_github_action("test-coverage.yaml")
because the v3 of the artifact upload workflow is now deprecated.closes #11