Creates a MDB table for a specified OU or list of OUS. Can be called in a purrr statement for batch creating
Arguments
- df
data frame resulting from running
reshape_mdb_df()
orreshape_mdb_tx_df()
- 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
Examples
if (FALSE) {
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)}