| aec_age_trend_rate_bar | R Documentation | 
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.
aec_age_trend_rate_bar(collection, data, x, y, sex, group, log_scale = FALSE)
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  | 
A ggplot2 object
aec_age_trend_pc
aec_age_trend_rate_pc_change
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.