Commit 293b7ed1 authored by David Pinaud's avatar David Pinaud

add option to use a local copy of the dataset

parent 46f3b7f4
This diff is collapsed.
---
title: "Analyse de l'incidence du syndrôme grippal"
author: "Konrad Hinsen"
author: "David Pinaud"
output:
pdf_document:
toc: true
......@@ -43,8 +43,15 @@ 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)
Le téléchargement se fait s'il n'existe pas une copie locale du fichier téléchargé :
```{r}
if(file.exists("incidence-PAY-3.csv"))
{
data = read.csv("incidence-PAY-3.csv")
} else {
data = read.csv(data_url, skip=1, na.strings = "-")
write.csv(data, "incidence-PAY-3.csv", row.names=FALSE)
}
```
Regardons ce que nous avons obtenu:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment