View source: R/mo_gnabsi_table.R
mo_gnabsi_table | R Documentation |
Produce the monthly wide-format table for GNBSI . Takes long format data for either trusts or CCGs and turns it wide with 13 months as variables. The function will filter the data to a given collection, i.e. "K. pneumoniae", "E. coli" or "Pseudomonas" as exported in the HCAI DCS line lists.
mo_gnabsi_table(data_fm, collection, org_type)
data_fm |
A data frame to work on, usually either trust_dat_all or ccg_dat_all |
collection |
A text string giving the data collection |
org_type |
A string giving the organisation type, one of trust or ccg. Lower case. |
A wide data.frame with counts of cases by org and month.
library(dplyr)
data(monthly_ccg_data_raw)
head(monthly_ccg_data_raw)
ccg_dat_all <- monthly_ccg_data_raw %>%
rename(org_code = ccg_code, ho = apportioned) %>%
mutate(data_collection = "E. coli", co = total_cases - ho)
my_out_dat <- mo_gnabsi_table(data_fm = ccg_dat_all, collection = "E. coli",
org_type = "ccg")
head(my_out_dat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.