#+TITLE: Améliorer son journal de bord #+AUTHOR: Antoine RICHARD #+DATE: 10/04/2020 #+LANGUAGE: fr # #+PROPERTY: header-args :eval never-export #+HTML_HEAD: #+HTML_HEAD: #+HTML_HEAD: #+HTML_HEAD: #+HTML_HEAD: #+HTML_HEAD: * Données récoltées Tout d'abord chargeons les données collectées durant ce mooc. #+begin_src R :results output :session *R* :exports both data <- read.csv("data.csv", sep=";", header=TRUE) summary(data) #+end_src #+RESULTS: #+begin_example year month day t_morning t_afternoon Min. :2020 Min. :4 Min. : 3.00 Min. :5.00 Min. :16.0 1st Qu.:2020 1st Qu.:4 1st Qu.: 4.75 1st Qu.:5.25 1st Qu.:18.5 Median :2020 Median :4 Median : 6.50 Median :5.50 Median :21.0 Mean :2020 Mean :4 Mean : 6.50 Mean :5.50 Mean :21.0 3rd Qu.:2020 3rd Qu.:4 3rd Qu.: 8.25 3rd Qu.:5.75 3rd Qu.:23.5 Max. :2020 Max. :4 Max. :10.00 Max. :6.00 Max. :26.0 t_evening humidity wind_speed IQA Min. :11.0 Min. :0 Min. : 5.00 Min. :42.00 1st Qu.:13.5 1st Qu.:0 1st Qu.: 6.25 1st Qu.:44.25 Median :16.0 Median :0 Median : 7.50 Median :46.50 Mean :16.0 Mean :0 Mean : 7.50 Mean :46.50 3rd Qu.:18.5 3rd Qu.:0 3rd Qu.: 8.75 3rd Qu.:48.75 Max. :21.0 Max. :0 Max. :10.00 Max. :51.00 #+end_example ** Temporalité des collectes Analysons le nombre de données collectées par mois #+begin_src R :results output graphics :file (org-babel-temp-file "figure" ".png") :exports both :width 600 :height 400 :session *R* hist(data$month) #+end_src #+RESULTS: [[file:/tmp/babel-bJ246X/figureDu3YQn.png]] ** Évolutions des données 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* plot(data$t_morning ~ data$day, type="l", col="blue", ylim=c(0.0,40.0), xlab="days", ylab="Temperature (°C)") lines(data$t_afternoon ~ data$day, col="red") lines(data$t_evening ~ data$day, col="green") legend(1,40,legend=c("Morning","Afternoon","Evening"),col=c("blue","red","green"),lty=1) #+end_src #+RESULTS: [[file:/tmp/babel-bJ246X/figurerWKWF0.png]] De l'humidité: #+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 (%)") #+end_src #+RESULTS: [[file:/tmp/babel-bJ246X/figureYIQvch.png]] 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* plot(data$wind ~ data$day, type="l", col="blue", xlab="days", ylab="Wind Speed (km/h)") #+end_src #+RESULTS: [[file:/tmp/babel-bJ246X/figureUv3yAT.png]] 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* plot(data$IQA ~ data$day, type="l", col="blue", xlab="time", ylab="Air Quality") #+end_src #+RESULTS: [[file:/tmp/babel-bJ246X/figureZp2Kv3.png]]