mf_fig1_fun: Monthly factsheet figure 1 function

View source: R/mf_fig1_fun.R

mf_fig1_funR Documentation

Monthly factsheet figure 1 function

Description

Function to produce figure 1 of the monthly factsheet.

Usage

mf_fig1_fun(data, collection)

Arguments

data

A data frame giving the counts of cases for a month per row, with a date colummn which will be used as x variable and count of cases for a collection to be used as the y variable.

collection

A string giving the name of the collection, which is the same as the name of the column in the data frame

Value

A ggplot showing the trend in counts of cases of the given collection

Examples


data(mf_trend_data)
head(mf_trend_data)

my_plot <- mf_fig1_fun(data = mf_trend_data, collection = "mrsa")
my_plot
my_plot <- mf_fig1_fun(data = mf_trend_data, collection = "mssa")
my_plot
my_plot <- mf_fig1_fun(data = mf_trend_data, collection = "ecoli")
my_plot
mf_trend_data$kleb <- NULL
names(mf_trend_data)[5] <- "kleb"
my_plot <- mf_fig1_fun(data = mf_trend_data, collection = "kleb")
my_plot


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