mo_gnabsi_table: Monthly table for Gram-negative blood stream infection data

View source: R/mo_gnabsi_table.R

mo_gnabsi_tableR Documentation

Monthly table for Gram-negative blood stream infection data

Description

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.

Usage

mo_gnabsi_table(data_fm, collection, org_type)

Arguments

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.

Value

A wide data.frame with counts of cases by org and month.

Examples

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)

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