update date format and change humidity to risk of rain

parent a54eab07
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
- Matin: 5 - Matin: 5
- Après-midi: 16 - Après-midi: 16
- Soir: 11 - Soir: 11
- Humidité (%): 0 - Risque de pluie (%): 0
- Vent (km/h): 10 (nord) - Vent (km/h): 10 (nord)
- Indice de Qualité de l'Air ([source](https://aqicn.org/city/france/rhonealpes/isere/grenoble-grands-boulevards/)): - Indice de Qualité de l'Air ([source](https://aqicn.org/city/france/rhonealpes/isere/grenoble-grands-boulevards/)):
- Grands Boulevards: 21 - Grands Boulevards: 21
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
- Matin: 6 - Matin: 6
- Après-midi: 26 - Après-midi: 26
- Soir: 21 - Soir: 21
- Humidité (%): 0 - Risque de pluie (%): 0
- Vent (km/h): 5 (direction variable) - Vent (km/h): 5 (direction variable)
- Indice de Qualité de l'Air ([source](https://aqicn.org/city/france/rhonealpes/isere/grenoble-grands-boulevards/)) - Indice de Qualité de l'Air ([source](https://aqicn.org/city/france/rhonealpes/isere/grenoble-grands-boulevards/))
- Grands Boulevards: NaN - Grands Boulevards: NaN
......
year;month;day;t_morning;t_afternoon;t_evening;humidity;wind_speed;IQA date;t_morning;t_afternoon;t_evening;rain_risk;wind_speed;IQA
2020;04;03;5;16;11;0;10;42 2020-04-03;5;16;11;0;10;42
2020;04;10;6;26;21;0;5;51 2020-04-10;6;26;21;0;5;51
2020-04-13;9;24;17;0;10;25
...@@ -18,77 +18,78 @@ Tout d'abord chargeons les données collectées durant ce mooc. ...@@ -18,77 +18,78 @@ Tout d'abord chargeons les données collectées durant ce mooc.
#+begin_src R :results output :session *R* :exports both #+begin_src R :results output :session *R* :exports both
data <- read.csv("data.csv", sep=";", header=TRUE) data <- read.csv("data.csv", sep=";", header=TRUE)
data$date <- as.Date(data$date, format="%Y-%m-%d")
summary(data) summary(data)
#+end_src #+end_src
#+RESULTS: #+RESULTS:
#+begin_example #+begin_example
year month day t_morning t_afternoon date t_morning t_afternoon t_evening rain_risk
Min. :2020 Min. :4 Min. : 3.00 Min. :5.00 Min. :16.0 Min. :2020-04-03 Min. :5.000 Min. :16 Min. :11.00 Min. :0
1st Qu.:2020 1st Qu.:4 1st Qu.: 4.75 1st Qu.:5.25 1st Qu.:18.5 1st Qu.:2020-04-06 1st Qu.:5.500 1st Qu.:20 1st Qu.:14.00 1st Qu.:0
Median :2020 Median :4 Median : 6.50 Median :5.50 Median :21.0 Median :2020-04-10 Median :6.000 Median :24 Median :17.00 Median :0
Mean :2020 Mean :4 Mean : 6.50 Mean :5.50 Mean :21.0 Mean :2020-04-08 Mean :6.667 Mean :22 Mean :16.33 Mean :0
3rd Qu.:2020 3rd Qu.:4 3rd Qu.: 8.25 3rd Qu.:5.75 3rd Qu.:23.5 3rd Qu.:2020-04-11 3rd Qu.:7.500 3rd Qu.:25 3rd Qu.:19.00 3rd Qu.:0
Max. :2020 Max. :4 Max. :10.00 Max. :6.00 Max. :26.0 Max. :2020-04-13 Max. :9.000 Max. :26 Max. :21.00 Max. :0
t_evening humidity wind_speed IQA wind_speed IQA
Min. :11.0 Min. :0 Min. : 5.00 Min. :42.00 Min. : 5.000 Min. :25.00
1st Qu.:13.5 1st Qu.:0 1st Qu.: 6.25 1st Qu.:44.25 1st Qu.: 7.500 1st Qu.:33.50
Median :16.0 Median :0 Median : 7.50 Median :46.50 Median :10.000 Median :42.00
Mean :16.0 Mean :0 Mean : 7.50 Mean :46.50 Mean : 8.333 Mean :39.33
3rd Qu.:18.5 3rd Qu.:0 3rd Qu.: 8.75 3rd Qu.:48.75 3rd Qu.:10.000 3rd Qu.:46.50
Max. :21.0 Max. :0 Max. :10.00 Max. :51.00 Max. :10.000 Max. :51.00
#+end_example #+end_example
** Temporalité des collectes ** Temporalité des collectes
Analysons le nombre de données collectées par mois Analysons le nombre de données collectées par jour
#+begin_src R :results output graphics :file (org-babel-temp-file "figure" ".png") :exports both :width 600 :height 400 :session *R* #+begin_src R :results output graphics :file (org-babel-temp-file "figure" ".png") :exports both :width 600 :height 400 :session *R*
hist(data$month) hist(data$date, col="blue", breaks=30)
#+end_src #+end_src
#+RESULTS: #+RESULTS:
[[file:/tmp/babel-bJ246X/figureDu3YQn.png]] [[file:/tmp/babel-gVAqEf/figureP0VUCp.png]]
** Évolutions des données ** Évolutions des données
Analysons l'évolution des températures Analysons l'évolution des températures
#+begin_src R :results output graphics :file (org-babel-temp-file "figure" ".png") :exports both :width 600 :height 400 :session *R* #+begin_src R :results output graphics :file (org-babel-temp-file "figure" ".png") :exports both :width 600 :height 400 :session *R*
plot(data$t_morning ~ data$day, type="l", col="blue", ylim=c(0.0,40.0), xlab="days", ylab="Temperature (°C)") plot(data$t_morning ~ data$date, type="l", col="blue", ylim=c(0.0,40.0), xlab="date", ylab="Temperature (°C)")
lines(data$t_afternoon ~ data$day, col="red") lines(data$t_afternoon ~ data$date, col="red")
lines(data$t_evening ~ data$day, col="green") lines(data$t_evening ~ data$date, col="green")
legend(1,40,legend=c("Morning","Afternoon","Evening"),col=c("blue","red","green"),lty=1) legend(1,40,legend=c("Morning","Afternoon","Evening"),col=c("blue","red","green"),lty=1)
#+end_src #+end_src
#+RESULTS: #+RESULTS:
[[file:/tmp/babel-bJ246X/figurerWKWF0.png]] [[file:/tmp/babel-KTKdwl/figureHNgB2t.png]]
De l'humidité: Du risque d'averse:
#+begin_src R :results output graphics :file (org-babel-temp-file "figure" ".png") :exports both :width 600 :height 400 :session *R* #+begin_src R :results output graphics :file (org-babel-temp-file "figure" ".png") :exports both :width 600 :height 400 :session *R*
plot(data$humidity ~ data$day, type="l", col="blue", xlab="days", ylab="Humidity (%)") plot(data$rain_risk ~ data$date, type="l", col="blue", xlab="date", ylab="Rain Risk (%)")
#+end_src #+end_src
#+RESULTS: #+RESULTS:
[[file:/tmp/babel-bJ246X/figureYIQvch.png]] [[file:/tmp/babel-KTKdwl/figurebDo7XU.png]]
De la vitesse du vent: De la vitesse du vent:
#+begin_src R :results output graphics :file (org-babel-temp-file "figure" ".png") :exports both :width 600 :height 400 :session *R* #+begin_src R :results output graphics :file (org-babel-temp-file "figure" ".png") :exports both :width 600 :height 400 :session *R*
plot(data$wind ~ data$day, type="l", col="blue", xlab="days", ylab="Wind Speed (km/h)") plot(data$wind ~ data$date, type="l", col="blue", xlab="date", ylab="Wind Speed (km/h)")
#+end_src #+end_src
#+RESULTS: #+RESULTS:
[[file:/tmp/babel-bJ246X/figureUv3yAT.png]] [[file:/tmp/babel-6G788d/figureCLB4jQ.png]]
De l'Indice de qualité de l'air: De l'Indice de qualité de l'air:
#+begin_src R :results output graphics :file (org-babel-temp-file "figure" ".png") :exports both :width 600 :height 400 :session *R* #+begin_src R :results output graphics :file (org-babel-temp-file "figure" ".png") :exports both :width 600 :height 400 :session *R*
plot(data$IQA ~ data$day, type="l", col="blue", xlab="time", ylab="Air Quality") plot(data$IQA ~ data$date, type="l", col="blue", xlab="date", ylab="Air Quality")
#+end_src #+end_src
#+RESULTS: #+RESULTS:
[[file:/tmp/babel-bJ246X/figureZp2Kv3.png]] [[file:/tmp/babel-KTKdwl/figureDFXrlW.png]]
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