plot_provincial_detrended: Plotting Provincial Detrended Data

Description Usage Arguments Examples

Description

This function plots provincial detrended time series data.

Usage

1
2

Arguments

df

detrended data set

COD

cause of death category. The different options are "All_deaths_rate","AllRes_deaths_rate", "PI_deaths_rate", "POther_deaths_rate", "Flu_deaths_rate" or "RSV_deaths_rate".

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## The function is currently defined as
plot_provincial_detrended <- function(df,
                                      COD){
  df %>%
    filter(death == COD) %>%
    ggplot()+
    geom_line(aes(x = tt, y = rates), col = "black")+
    geom_line(aes(x = tt, y = trend),col = "red", size = 1)+
    geom_line(aes(x = tt, y = detrended), col = "blue")+
    facet_wrap(~DeathProv, nrow = 3, ncol = 3, scales = "free_y") +
    theme_bw()+
    xlab("") +
    ylab("")+
    ggtitle(paste(gsub("_", " ", COD),"per 100 000"))+
    theme(plot.caption = element_text(size = 8, hjust = 0))
}

EMDominic/SThelperfunctions documentation built on Aug. 4, 2020, 12:02 a.m.