diff --git a/courses/01-dataviz-intro.pdf b/courses/01-dataviz-intro.pdf
index e35018e..2ee8c35 100644
Binary files a/courses/01-dataviz-intro.pdf and b/courses/01-dataviz-intro.pdf differ
diff --git a/courses/02-perception-couleurs.pdf b/courses/02-perception-couleurs.pdf
new file mode 100644
index 0000000..61a31db
Binary files /dev/null and b/courses/02-perception-couleurs.pdf differ
diff --git a/courses/03-design-tabulaire.pdf b/courses/03-design-tabulaire.pdf
new file mode 100644
index 0000000..1e548f8
Binary files /dev/null and b/courses/03-design-tabulaire.pdf differ
diff --git a/courses/04-interactivite.pdf b/courses/04-interactivite.pdf
new file mode 100644
index 0000000..0098081
Binary files /dev/null and b/courses/04-interactivite.pdf differ
diff --git a/courses/06_graphes.pdf b/courses/06_graphes.pdf
new file mode 100644
index 0000000..f1a8d8c
Binary files /dev/null and b/courses/06_graphes.pdf differ
diff --git a/courses/07_time_text.pdf b/courses/07_time_text.pdf
new file mode 100644
index 0000000..797aea0
Binary files /dev/null and b/courses/07_time_text.pdf differ
diff --git a/courses/bar_race.gif b/courses/bar_race.gif
index ec31562..0d4c042 100644
Binary files a/courses/bar_race.gif and b/courses/bar_race.gif differ
diff --git a/courses/lab01-correction.Rmd b/courses/lab01-correction.Rmd
index e28aa5a..baf2423 100644
--- a/courses/lab01-correction.Rmd
+++ b/courses/lab01-correction.Rmd
@@ -7,6 +7,7 @@ output: html_document
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
+library(ggplot2)
```
## Ouvrir le dataset "mtcars"
diff --git a/courses/lab01-correction.html b/courses/lab01-correction.html
new file mode 100644
index 0000000..2750729
--- /dev/null
+++ b/courses/lab01-correction.html
@@ -0,0 +1,502 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Ouvrir le dataset “mtcars”
+
+
+
représenter le “Gross horsepower” en fonction du nombre de cylindres
+
data("mtcars")
+
+ggplot(data = mtcars,
+ aes(x = as.factor(cyl),
+ y = hp)) +
+ geom_jitter(width = .2)
+
+
+
+
utiliser l’encodage multiple sur le nombre de cylindres
+
ggplot(data = mtcars,
+ aes(x = as.factor(cyl),
+ y = hp,
+ size = cyl,
+ color = cyl)) +
+ geom_jitter(width = .2, alpha = .6) +
+ theme_minimal() +
+ theme(legend.position = "none")
+
+
+
+
+
Paufiner le plot (axes, titres, thème)
+
ggplot(data = mtcars,
+ aes(x = as.factor(cyl),
+ y = carb,
+ size = hp,
+ color = hp)) +
+ geom_jitter(width = .2, alpha = .6) +
+ theme_minimal() +
+ labs(x = "Cylinders",
+ y = "Carburators")
+
+
+
+
représenter la distribution du nombre de miles per gallon en histogramme
+
ggplot(mtcars,
+ aes(x= mpg)) +
+ geom_histogram(bins = sqrt(nrow(mtcars)))
+
+
+
+
représenter la distribution du nombre de miles per gallon en boxplot
+
ggplot(mtcars,
+ aes(x= 1, y= mpg)) +
+ geom_boxplot()
+
+
+
+
representer la distribution du nombre de miles per gallon en fonction du nombre de cylindres
+
ggplot(mtcars,
+ aes(x= as.factor(cyl), y= mpg)) +
+ geom_violin(fill = "grey70")
+
+
+
+
ajouter les points par dessus la distribution
+
ggplot(mtcars,
+ aes(x= as.factor(cyl), y= mpg)) +
+ geom_violin(fill = "grey70") +
+ geom_jitter(aes(color = cyl),width = .15)
+
+
+
+
paufiner le plot (axes, titres, thème)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/courses/lab01-ggplot-intro.Rmd b/courses/lab01-ggplot-intro.Rmd
index bba7e18..1b228ba 100644
--- a/courses/lab01-ggplot-intro.Rmd
+++ b/courses/lab01-ggplot-intro.Rmd
@@ -13,9 +13,6 @@ output:
self-contained: true
beforeInit: "addons/macros.js"
highlightLines: true
- pdf_document:
- seal: false
-
---
```{r setup, include=FALSE}
diff --git a/courses/lab01-ggplot-intro.pdf b/courses/lab01-ggplot-intro.pdf
index 0b7fbff..38a970b 100644
Binary files a/courses/lab01-ggplot-intro.pdf and b/courses/lab01-ggplot-intro.pdf differ
diff --git a/courses/lab02-perception-colors.Rmd b/courses/lab02-perception-colors.Rmd
index 9407271..a620a6b 100644
--- a/courses/lab02-perception-colors.Rmd
+++ b/courses/lab02-perception-colors.Rmd
@@ -25,6 +25,18 @@ library(see)
library(RColorBrewer)
```
+class: center, middle, title
+
+# Lab 2: Perception et couleurs
+
+### 2019-2020
+
+## Dr. Antoine Neuraz
+
+### AHU Informatique médicale
+#### Hôpital Necker-Enfants malades, Université de Paris
+
+
---
class: inverse, center, middle
# Perception des différentes marques dans ggplot2
@@ -240,6 +252,14 @@ class: full
#### changer la palette par défaut vers une autre palette disponible
+---
+```{r}
+dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
+ggplot(dsamp, aes(carat, price)) +
+ geom_point(aes(colour = color)) +
+ scale_color_brewer(palette = "Set3") +
+ facet_wrap(~color)
+```
---
@@ -254,17 +274,8 @@ class: full
#### Caler la palette sur le carat moyen
#### Annoter le plot avec une ligne désignant le carat moyen et un texte expliquant cette ligne
-
-
-
---
-```{r}
-dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
-ggplot(dsamp, aes(carat, price)) +
- geom_point(aes(colour = color)) +
- scale_color_brewer(palette = "Set3") +
- facet_wrap(~color)
-```
+
```{r}
@@ -273,7 +284,8 @@ ggplot(dsamp, aes(carat, price)) +
scale_color_distiller(palette="RdYlBu")
```
-```{r}
+---
+```{r, eval = F}
#showtext_auto()
#font_add_google("Schoolbell", "bell")
@@ -307,7 +319,40 @@ ggplot(dsamp, aes(carat, price)) +
legend.position = "none")
```
+---
+```{r, echo = F}
+
+#showtext_auto()
+#font_add_google("Schoolbell", "bell")
+
+font_family = "sans"
+annotate_color = "grey50"
+
+midpoint = (max(dsamp$carat)-min(dsamp$carat))/2
+
+ggplot(dsamp, aes(carat, price)) +
+ geom_vline(xintercept = midpoint, color = annotate_color) +
+ geom_point(aes(colour = carat)) +
+ scale_color_gradient2(low = "#d8b365",
+ mid="#f5f5f5",
+ high="#5ab4ac",
+ midpoint = midpoint) +
+ annotate("text",
+ x=.78, y=15000, hjust=1, srt=40,
+ label ="this is the midpoint",
+ family=font_family,
+ color=annotate_color) +
+ annotate("curve",
+ x = .8, xend=midpoint-.01, y=15000, yend = 14000,
+ curvature = -.5,
+ color=annotate_color ,
+ arrow=arrow(length = unit(0.03, "npc") )) +
+ theme_elegant() +
+ theme(panel.grid.minor = element_blank(),
+ panel.grid.major.x = element_blank(),
+ legend.position = "none")
+```
diff --git a/courses/lab02-perception-colors.html b/courses/lab02-perception-colors.html
index 8b8f082..d80ca31 100644
--- a/courses/lab02-perception-colors.html
+++ b/courses/lab02-perception-colors.html
@@ -13,6 +13,18 @@
+class: center, middle, title
+
+# Lab 2: Perception et couleurs
+
+### 2019-2020
+
+## Dr. Antoine Neuraz
+
+### AHU Informatique médicale
+#### Hôpital Necker-Enfants malades, </br> Université de Paris
+
+
---
class: inverse, center, middle
# Perception des différentes marques dans ggplot2
@@ -236,6 +248,19 @@ class: full
#### changer la palette par défaut vers une autre palette disponible
+---
+
+```r
+dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
+ggplot(dsamp, aes(carat, price)) +
+ geom_point(aes(colour = color)) +
+ scale_color_brewer(palette = "Set3") +
+ facet_wrap(~color)
+```
+
+![](lab02-perception-colors_files/figure-html/unnamed-chunk-12-1.png)<!-- -->
+
+
---
## TODO: couleurs 2
@@ -248,20 +273,8 @@ class: full
#### Caler la palette sur le carat moyen
#### Annoter le plot avec une ligne désignant le carat moyen et un texte expliquant cette ligne
-
-
-
---
-```r
-dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
-ggplot(dsamp, aes(carat, price)) +
- geom_point(aes(colour = color)) +
- scale_color_brewer(palette = "Set3") +
- facet_wrap(~color)
-```
-
-![](lab02-perception-colors_files/figure-html/unnamed-chunk-12-1.png)<!-- -->
```r
@@ -272,6 +285,7 @@ ggplot(dsamp, aes(carat, price)) +
![](lab02-perception-colors_files/figure-html/unnamed-chunk-13-1.png)<!-- -->
+---
```r
#showtext_auto()
@@ -306,7 +320,8 @@ ggplot(dsamp, aes(carat, price)) +
legend.position = "none")
```
-![](lab02-perception-colors_files/figure-html/unnamed-chunk-14-1.png)<!-- -->
+---
+![](lab02-perception-colors_files/figure-html/unnamed-chunk-15-1.png)<!-- -->
diff --git a/courses/lab02-perception-colors.pdf b/courses/lab02-perception-colors.pdf
new file mode 100644
index 0000000..b21ab7f
Binary files /dev/null and b/courses/lab02-perception-colors.pdf differ
diff --git a/courses/lab02-perception-colors_files/figure-html/unnamed-chunk-10-1.png b/courses/lab02-perception-colors_files/figure-html/unnamed-chunk-10-1.png
index b2b90bd..425b5bc 100644
Binary files a/courses/lab02-perception-colors_files/figure-html/unnamed-chunk-10-1.png and b/courses/lab02-perception-colors_files/figure-html/unnamed-chunk-10-1.png differ
diff --git a/courses/lab02-perception-colors_files/figure-html/unnamed-chunk-11-1.png b/courses/lab02-perception-colors_files/figure-html/unnamed-chunk-11-1.png
index 01c18e0..81a117d 100644
Binary files a/courses/lab02-perception-colors_files/figure-html/unnamed-chunk-11-1.png and b/courses/lab02-perception-colors_files/figure-html/unnamed-chunk-11-1.png differ
diff --git a/courses/lab02-perception-colors_files/figure-html/unnamed-chunk-13-1.png b/courses/lab02-perception-colors_files/figure-html/unnamed-chunk-13-1.png
index c13cffd..0e36201 100644
Binary files a/courses/lab02-perception-colors_files/figure-html/unnamed-chunk-13-1.png and b/courses/lab02-perception-colors_files/figure-html/unnamed-chunk-13-1.png differ
diff --git a/courses/lab02-perception-colors_files/figure-html/unnamed-chunk-14-1.png b/courses/lab02-perception-colors_files/figure-html/unnamed-chunk-14-1.png
index 945b326..95c6f7c 100644
Binary files a/courses/lab02-perception-colors_files/figure-html/unnamed-chunk-14-1.png and b/courses/lab02-perception-colors_files/figure-html/unnamed-chunk-14-1.png differ
diff --git a/courses/lab02-perception-colors_files/figure-html/unnamed-chunk-15-1.png b/courses/lab02-perception-colors_files/figure-html/unnamed-chunk-15-1.png
index 945b326..95c6f7c 100644
Binary files a/courses/lab02-perception-colors_files/figure-html/unnamed-chunk-15-1.png and b/courses/lab02-perception-colors_files/figure-html/unnamed-chunk-15-1.png differ
diff --git a/courses/lab02-perception-colors_files/figure-html/unnamed-chunk-7-1.png b/courses/lab02-perception-colors_files/figure-html/unnamed-chunk-7-1.png
index f29a83c..993b357 100644
Binary files a/courses/lab02-perception-colors_files/figure-html/unnamed-chunk-7-1.png and b/courses/lab02-perception-colors_files/figure-html/unnamed-chunk-7-1.png differ
diff --git a/courses/lab03-tabulaire.html b/courses/lab03-tabulaire.html
index 0920651..19253ef 100644
--- a/courses/lab03-tabulaire.html
+++ b/courses/lab03-tabulaire.html
@@ -44,8 +44,8 @@ class: center, middle, title
read_csv("lab03_data/notes.csv") -> notes
```
-