Commit 430e60a9 authored by Konrad Hinsen's avatar Konrad Hinsen

Petites corrections

parent 38012170
...@@ -59,14 +59,13 @@ Voici l'explication des colonnes donnée sur [[https://ns.sentiweb.fr/incidence/ ...@@ -59,14 +59,13 @@ Voici l'explication des colonnes donnée sur [[https://ns.sentiweb.fr/incidence/
| ~geo_name~ | Libellé de la zone géographique (ce libellé peut être modifié sans préavis) | | ~geo_name~ | Libellé de la zone géographique (ce libellé peut être modifié sans préavis) |
** Téléchargement ** Téléchargement
La première ligne du fichier CSV est un commentaire, que nous ignorons en précisant `skip=1`. La première ligne du fichier CSV est un commentaire, que nous ignorons en précisant ~skip=1~.
#+BEGIN_SRC R :session :results silent :var url=data-url #+BEGIN_SRC R :session :results silent :var url=data-url
data = read.csv(trimws(url), skip=1) data = read.csv(trimws(url), skip=1)
#+END_SRC #+END_SRC
Après avoir téléchargé les données, nous commençons par l'extraction des données qui nous intéressent. D'abord nous découpons le contenu du fichier en lignes, dont nous jetons la première qui ne contient qu'un commentaire. Les autres lignes sont découpées en colonnes. Regardons ce que nous avons obtenu !
#+BEGIN_SRC R :results output #+BEGIN_SRC R :results output
head(data) head(data)
tail(data) tail(data)
......
#+TITLE: Incidence of influenza-like illness in France #+TITLE: Incidence of influenza-like illness in France
#+LANGUAGE: fr #+LANGUAGE: en
#+OPTIONS: *:nil num:1 toc:t #+OPTIONS: *:nil num:1 toc:t
# #+HTML_HEAD: <link rel="stylesheet" title="Standard" href="http://orgmode.org/worg/style/worg.css" type="text/css" /> # #+HTML_HEAD: <link rel="stylesheet" title="Standard" href="http://orgmode.org/worg/style/worg.css" type="text/css" />
...@@ -122,7 +122,7 @@ for week, inc in data: ...@@ -122,7 +122,7 @@ for week, inc in data:
No problem - fine! No problem - fine!
** Data conversion ** Date conversion
In order to facilitate the subsequent treatment, we replace the ISO week numbers by the dates of each week's Monday. This is also a good occasion to sort the lines by increasing data, and to convert the incidences from strings to integers. In order to facilitate the subsequent treatment, we replace the ISO week numbers by the dates of each week's Monday. This is also a good occasion to sort the lines by increasing data, and to convert the incidences from strings to integers.
#+BEGIN_SRC python :results silent #+BEGIN_SRC python :results silent
......
...@@ -41,8 +41,9 @@ This is the documentation of the data from [the download site](https://ns.sentiw ...@@ -41,8 +41,9 @@ This is the documentation of the data from [the download site](https://ns.sentiw
| `geo_insee` | Identifier of the geographic area, from INSEE https://www.insee.fr | | `geo_insee` | Identifier of the geographic area, from INSEE https://www.insee.fr |
| `geo_name` | Geographic label of the area, corresponding to INSEE code. This label is not an id and is only provided for human reading | | `geo_name` | Geographic label of the area, corresponding to INSEE code. This label is not an id and is only provided for human reading |
The first line of the CSV file is a comment, which we ignore with `skip=1`.
### Download ### Download
The first line of the CSV file is a comment, which we ignore with `skip=1`.
```{r} ```{r}
data = read.csv(data_url, skip=1) data = read.csv(data_url, skip=1)
``` ```
......
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