Description Usage Arguments Examples
This function plots provincial detrended time series data.
1 2 | plot_provincial_detrended(df,
COD)
|
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". |
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))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.