Currently using purr::map_df. Here is an example from L2C quarterly report:
# Loop over all categorical vars
cat_stats <- purrr::map_df(
quos(gender_f, race_3cat_f, hispanic_f),
function(x) {
demographics %>%
filter(screened_in == 1) %>%
freq_table({{x}}) %>%
freq_format(recipe = "n (percent)", digits = 1) %>%
select(var, cat, formatted_stats) %>%
# Add a row with the var name only
add_row(var = quo_name(x), .before = 1) %>%
# Add blank row below
add_row(var = "", cat = "", formatted_stats = "")
}
)
Currently using purr::map_df. Here is an example from L2C quarterly report:
I should either: