Commit 8e20aa38 authored by Christian Wiat's avatar Christian Wiat

ajout chargement si csv non present en local

parent 0934152e
......@@ -44,7 +44,16 @@ 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)
fpath="E:/git/mooc-rr/module3/exo1/incidence-PAY-3.csv"
if ( !file.exists(fpath) ){
# non local: download
fm<-readLines(data_url)
# write on disk
write(fm,fpath)
}
# oui, il est local : read local disk
data = read.csv(fpath, skip=1)
```
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