aec_age_trend_rate_bar: aec_age_trend_rate

aec_age_trend_rate_barR Documentation

aec_age_trend_rate

Description

Produce a bar graph showing the change in rate of infection over time, by age group. This replaces aec_age_trend_pc in the Annual Epidemiological Commentary. See age_trends_data for example of format for data to be used with this function.

Usage

aec_age_trend_rate_bar(collection, data, x, y, sex, group, log_scale = FALSE)

Arguments

collection

One of CDI or Bacteraemia

data

A data frame

x

Variable giving financial year

y

Variable giving rate for age group by sex and year

sex

Variable giving the sex group

group

Variable giving age group (using mandatory age groupings)

log_scale

Logical for whether a log y scale should be used. Defaults to FALSE

Value

A ggplot2 object

See Also

aec_age_trend_pc

aec_age_trend_rate_pc_change

Examples

data(age_trends_data)
q <- aec_age_trend_rate_bar(collection = "CDI", data = age_trends_data,
    x = "fyear6", y = "rate", sex = "sex", group = "age_group_new",
    log_scale = FALSE)
q

publichealthengland/hcaidcs documentation built on Jan. 17, 2024, 1:34 p.m.