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
Using a function to create the "list of lists" #62
Comments
@estephanmoana, Thanks for the question. I'm glad to know The current version of |
@estephanmoana, here is an example using library(qwraps2)
options(qwraps2_markup = "markdown")
my_data <- mtcars[c("mpg", "wt")]
summ_stats <-
qsummary(my_data,
numeric_summaries = list("mean (sd)" = "~ qwraps2::mean_sd(%s)",
"min" = "~ qwraps2::frmt(min(%s))",
"max" = "~ qwraps2::frmt(max(%s))",
"median (IQR)" = "~ qwraps2::median_iqr(%s)"))
names(summ_stats)
# [1] "mpg" "wt"
names(summ_stats)[2] <- "Weight"
names(summ_stats)
# [1] "mpg" "Weight"
summary_table(my_data, summ_stats)
|
Hi, took me a while but I developed a function that makes it a bit easier (at least for me) to automate making tables using qwraps2. See code attached, I hope this might help others using your nice package. Cheers. |
Hi, I've been using qwraps2 to create nice looking tables and it has worked like a charm. Now I'm trying to automate making the "list of lists" using a function, however I have not been able to make it work. Here's a draft of the function:
The output of this function should be a list-of-lists to pass to the summaries argument of summary_table:
summ_table <- summ.stats(data, "var")
summary_table(data, summ_table)
Can you provide any pointers on how to make such function work? Thank you.
The text was updated successfully, but these errors were encountered: