diff --git a/journal/Entry_00.md b/journal/Entry_00.md index 4e22d283d50d1f70c93c476ab5ac6a4183567819..b9771df388e8ad4e95a8fe9d27f398c58ecdfc38 100644 --- a/journal/Entry_00.md +++ b/journal/Entry_00.md @@ -8,7 +8,7 @@ - Matin: 5 - Après-midi: 16 - Soir: 11 - - Humidité (%): 0 + - Risque de pluie (%): 0 - Vent (km/h): 10 (nord) - Indice de Qualité de l'Air ([source](https://aqicn.org/city/france/rhonealpes/isere/grenoble-grands-boulevards/)): - Grands Boulevards: 21 @@ -40,4 +40,4 @@ Module 1 terminé - Indexation numérique: [DocFetcher](http://docfetcher.sourceforge.net/fr/index.html) - \ No newline at end of file + diff --git a/journal/Entry_01.md b/journal/Entry_01.md index 1ba1e86f672cc42afdc12a55fecbab3e2cb0c556..c0478546c3de7ceea0074edcf35050d8cb91c4bd 100644 --- a/journal/Entry_01.md +++ b/journal/Entry_01.md @@ -10,7 +10,7 @@ - Matin: 6 - Après-midi: 26 - Soir: 21 - - Humidité (%): 0 + - Risque de pluie (%): 0 - Vent (km/h): 5 (direction variable) - Indice de Qualité de l'Air ([source](https://aqicn.org/city/france/rhonealpes/isere/grenoble-grands-boulevards/)) - Grands Boulevards: NaN diff --git a/module2/exo4/data.csv b/module2/exo4/data.csv index b69a95febdba559bc8a5091e538ff9488477578d..005e58f6fcfc590896d49600a36b72034d7cab67 100644 --- a/module2/exo4/data.csv +++ b/module2/exo4/data.csv @@ -1,3 +1,4 @@ -year;month;day;t_morning;t_afternoon;t_evening;humidity;wind_speed;IQA -2020;04;03;5;16;11;0;10;42 -2020;04;10;6;26;21;0;5;51 +date;t_morning;t_afternoon;t_evening;rain_risk;wind_speed;IQA +2020-04-03;5;16;11;0;10;42 +2020-04-10;6;26;21;0;5;51 +2020-04-13;9;24;17;0;10;25 diff --git a/module2/exo4/exercice_R_fr.org b/module2/exo4/exercice_R_fr.org index 7b27c51ed67defeffab3d98e398efba1cce7b4f5..757400e93391ef6850b9cd3fa8b0784a26c86389 100644 --- a/module2/exo4/exercice_R_fr.org +++ b/module2/exo4/exercice_R_fr.org @@ -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 data <- read.csv("data.csv", sep=";", header=TRUE) +data$date <- as.Date(data$date, format="%Y-%m-%d") 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 + date t_morning t_afternoon t_evening rain_risk + Min. :2020-04-03 Min. :5.000 Min. :16 Min. :11.00 Min. :0 + 1st Qu.:2020-04-06 1st Qu.:5.500 1st Qu.:20 1st Qu.:14.00 1st Qu.:0 + Median :2020-04-10 Median :6.000 Median :24 Median :17.00 Median :0 + Mean :2020-04-08 Mean :6.667 Mean :22 Mean :16.33 Mean :0 + 3rd Qu.:2020-04-11 3rd Qu.:7.500 3rd Qu.:25 3rd Qu.:19.00 3rd Qu.:0 + Max. :2020-04-13 Max. :9.000 Max. :26 Max. :21.00 Max. :0 + wind_speed IQA + Min. : 5.000 Min. :25.00 + 1st Qu.: 7.500 1st Qu.:33.50 + Median :10.000 Median :42.00 + Mean : 8.333 Mean :39.33 + 3rd Qu.:10.000 3rd Qu.:46.50 + Max. :10.000 Max. :51.00 #+end_example ** 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* -hist(data$month) +hist(data$date, col="blue", breaks=30) #+end_src #+RESULTS: - [[file:/tmp/babel-bJ246X/figureDu3YQn.png]] + [[file:/tmp/babel-gVAqEf/figureP0VUCp.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") +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$date, col="red") +lines(data$t_evening ~ data$date, 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]] + [[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* -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 #+RESULTS: - [[file:/tmp/babel-bJ246X/figureYIQvch.png]] + [[file:/tmp/babel-KTKdwl/figurebDo7XU.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)") +plot(data$wind ~ data$date, type="l", col="blue", xlab="date", ylab="Wind Speed (km/h)") #+end_src #+RESULTS: - [[file:/tmp/babel-bJ246X/figureUv3yAT.png]] + [[file:/tmp/babel-6G788d/figureCLB4jQ.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") +plot(data$IQA ~ data$date, type="l", col="blue", xlab="date", ylab="Air Quality") #+end_src #+RESULTS: - [[file:/tmp/babel-bJ246X/figureZp2Kv3.png]] + [[file:/tmp/babel-KTKdwl/figureDFXrlW.png]]