From 003870eef5f31737070464d1627d75ed8da8e63b Mon Sep 17 00:00:00 2001 From: Clement MOLINA Date: Mon, 4 Sep 2023 17:08:48 +0200 Subject: [PATCH] mis a jours --- journal/Journal de bord.md | 6 ++++- module3/analyse cours.Rmd | 29 +++++++++++++++++++++++ module3/exo1/analyse-syndrome-grippal.Rmd | 4 +++- 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/journal/Journal de bord.md b/journal/Journal de bord.md index 70d13a2..91ca3bf 100644 --- a/journal/Journal de bord.md +++ b/journal/Journal de bord.md @@ -41,4 +41,8 @@ Deux lien pour les synthaxes de marckdown #Module 3 - 24/08/2023 1 heure chapitre 1 à 3 -- [ ] importer les donnée du resaux sentinel +- [x)] Importer les données du resaux sentinel + +- 31/08/2023 1h chapitre 4 + +- 04/09/2023 \ No newline at end of file diff --git a/module3/analyse cours.Rmd b/module3/analyse cours.Rmd index 78be6b0..2dd5ef6 100644 --- a/module3/analyse cours.Rmd +++ b/module3/analyse cours.Rmd @@ -74,3 +74,32 @@ plot(data$date, data$inc, type="l", xlab="Date", ylab="Incidence hebdomadaire") with(tail(data, 200), plot(date, inc, type="l", xlab="Date", ylab="Incidence hebdomadaire")) ``` +```{r} +pic_annuel = function(annee) { + debut = paste0(annee-1,"-08-01") + fin = paste0(annee,"-08-01") + semaines = data$date > debut & data$date <= fin + sum(data$inc[semaines], na.rm=TRUE) + } + +``` + +```{r} +inc_annuelle = data.frame(annee = 1986:2023, + incidence = sapply(1986:2023, pic_annuel)) +head(inc_annuelle) + +``` + +```{r} +plot(inc_annuelle, type="p", xlab="Année", ylab="Incidence annuelle") +``` + +```{r} +tail(inc_annuelle[order(-inc_annuelle$incidence),]) +``` + +```{r} +hist(inc_annuelle$incidence, breaks=10, xlab="Incidence annuelle", ylab="Nb d'observations", main="") +``` + diff --git a/module3/exo1/analyse-syndrome-grippal.Rmd b/module3/exo1/analyse-syndrome-grippal.Rmd index 771e78f..a6b7db8 100644 --- a/module3/exo1/analyse-syndrome-grippal.Rmd +++ b/module3/exo1/analyse-syndrome-grippal.Rmd @@ -24,6 +24,8 @@ knitr::opts_chunk$set(echo = TRUE) Les données de l'incidence du syndrome grippal sont disponibles du site Web du [Réseau Sentinelles](http://www.sentiweb.fr/). Nous les récupérons sous forme d'un fichier en format CSV dont chaque ligne correspond à une semaine de la période demandée. Nous téléchargeons toujours le jeu de données complet, qui commence en 1984 et se termine avec une semaine récente. L'URL est: ```{r} data_url = "http://www.sentiweb.fr/datasets/incidence-PAY-3.csv" +data_file = "Syndromegripal.csv" +if (!file.exists(data_file)) {download.file(data_url,data_file,methode= "auto")} ``` Voici l'explication des colonnes donnée sur le [sur le site d'origine](https://ns.sentiweb.fr/incidence/csv-schema-v1.json): @@ -44,7 +46,7 @@ Voici l'explication des colonnes donnée sur le [sur le site d'origine](https:// La première ligne du fichier CSV est un commentaire, que nous ignorons en précisant `skip=1`. ### Téléchargement ```{r} -data = read.csv(data_url, skip=1) +data = read.csv(data_file, skip=1) ``` Regardons ce que nous avons obtenu: -- 2.18.1