Open mbcann01 opened 1 month ago
@mbcann01 I think I got this to work. I created a function cb_custom_summary_stats_to_ft
in file cb_custom_summary_stats_to_ft.R
to maintain the same flextable formatting for the codebook and modified the codebook function to allow the user to inject a list of data frames containing arbitrary summary statistics for specified columns. Per Morri's suggestion, I added a new argument, omit_na_columns
, that prevents "Missing" from appearing as a category for specified variables in the resulting codebook file.
I've made the updates discussed on 6/14/2024 to address this issue:
cb_add_custom_summary_stats
, that allows the user to choose from a list of pre-defined statistics or create custom functions and inject the names of these defined functions into the codebook
function was created.cb_custom_summary_stats_to_ft
was updated to change the width of the summary statistics table depending on the number of columns and accept input for user-determined header labels.
Overview
on 2024-05-23, I got the following email:
My response was:
For the purpose of this issue, I'm particularly interested in option 2 above. I wonder if it would be relatively easy to create a function that would allow users to inject arbitrary tables into the summary stats section of the codebook.