mo_std_table: Monthly CCG table

View source: R/mo_std_table.R

mo_std_tableR Documentation

Monthly CCG table

Description

Produce the monthly wide-format table for CCGs. Takes long format data for CCGs and turns it wide with 13 months as variables. Hard coded to operate on dataframe 'ccg_dat_all', it filters the data to a given collection, e.g. "MRSA" or "E. coli" as exported in the HCAI DCS line lists.

Usage

mo_std_table(data_fm, collection, column)

Arguments

data_fm

The data frame on which to work, either ccg_dat_all or trust_dat_all

collection

A text string giving the data collection

column

A column which will be transposed

Value

A wide data.frame with counts of cases per month in columns with CCGs as rows

Examples

library(dplyr)
data(monthly_ccg_data_raw)
ccg_dat_all <- monthly_ccg_data_raw %>%
    rename(org_code = ccg_code)
out_dat <- mo_std_table(data_fm = ccg_dat_all, collection = "MRSA",
    column = "total_cases")
head(out_dat)

PublicHealthEngland/hcaidcs documentation built on Jan. 19, 2024, 8:38 a.m.