diff --git a/module3/exo1/influenza-like-illness-analysis.Rmd b/module3/exo1/influenza-like-illness-analysis.Rmd index edc2ac54940efd13e0a0cc7388565240bdb4fea8..e12efcb004838a869abb3b13858f70eae661592d 100644 --- a/module3/exo1/influenza-like-illness-analysis.Rmd +++ b/module3/exo1/influenza-like-illness-analysis.Rmd @@ -2,11 +2,11 @@ title: "Incidence of influenza-like illness in France" author: "Eleni Gkiouzepi" output: + pdf_document: + toc: true html_document: toc: true theme: journal - pdf_document: - toc: true documentclass: article classoption: a4paper header-includes: @@ -141,9 +141,9 @@ Since the peaks of the epidemic happen in winter, near the transition between ca The argument `na.rm=True` in the sum indicates that missing data points are removed. This is a reasonable choice since there is only one missing point, whose impact cannot be very strong. ```{r} yearly_peak = function(year) { - debut = paste0(year-1,"-08-01") - fin = paste0(year,"-08-01") - semaines = data$date > debut & data$date <= fin + start = paste0(year-1,"-08-01") + end = paste0(year,"-08-01") + semaines = data$date > start & data$date <= end sum(data$inc[semaines], na.rm=TRUE) } ``` @@ -164,7 +164,7 @@ head(annnual_inc) A plot of the annual incidences: ```{r} -plot(annnual_inc, type="p", xlab="Année", ylab="Annual incidence") +plot(annnual_inc, type="p", xlab="Year", ylab="Annual incidence") ``` ### Identification of the strongest epidemics