create_mdb | R Documentation |
Creates a MDB table for a specified OU or list of OUS. Can be called in a purrr statement for batch creating
create_mdb(df, ou, type = "main", legend = NULL, legend_height = 20)
df |
data frame resulting from running |
ou |
operating unit for which table is to be returned |
type |
type of table to be created, main or treatment |
legend |
can pass a legend to subtitle if desired, default is NULL |
legend_height |
adjusts the height of the preset legend |
mdb_gt a gt object formatted as the main or treatment table
## Not run:
create_mdb(mdb_tbl, "Global")
create_mdb(mdb_tbl_tx, "Zambia", type = "treatment")
# Batch produce tables
ou_batch <- mdb_tbl_tx %>%
filter(agg_type == "OU") %>%
distinct(operatingunit) %>% pull()
purrr::map(ou_batch, ~create_mdb(mdb_tbl, ou = .x))
# More advanced example selecting single indicator across numerous OUS
create_mdb(mdb_tbl_tx %>% filter(indicator == "VLC"),
c("Malawi", "Zambia"), type = "treatment") %>%
cols_unhide(operatingunit)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.