Skip to content

Commit d531934

Browse files
Change syntax chart(..., formula = ...) by chart(data = ..., ...)
1 parent e4099a4 commit d531934

File tree

1 file changed

+39
-42
lines changed

1 file changed

+39
-42
lines changed

inst/tutorials/A03La_univaries/A03La_univaries.Rmd

Lines changed: 39 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ author: "Guyliann Engels & Philippe Grosjean"
44
description: "**SDD I Module 3** Réalisation de différents graphiques univariés."
55
tutorial:
66
id: "A03La_univaries"
7-
version: 2.0.0/8
7+
version: 2.0.1/8
88
output:
99
learnr::tutorial:
1010
progressive: true
@@ -42,8 +42,6 @@ BioDataScience1::learnr_server(input, output, session)
4242

4343
- Vérifier l'acquisition des notions relatives aux diagrammes en violon
4444

45-
<!--- **Ce test comporte des questions théoriques ainsi que des questions pratiques. Ce test est certificatif.** -->
46-
4745
## Biométrie humaine
4846

4947
Intéressez vous au jeu de données sur la biométrie humaine ci-dessous.
@@ -63,24 +61,24 @@ chart(biometry, formula = ~ age | gender) +
6361
```
6462

6563
```{r histo_h3, exercise = TRUE}
66-
chart(___, formula = ~ ___ ___ ___) +
64+
chart(data = ___, ~ ___ ___ ___) +
6765
___(___)
6866
```
6967

7068
```{r histo_h3-hint-1}
71-
chart(DF, formula = ~ ___ | ___) +
69+
chart(data = DF, ~ ___ | ___) +
7270
geom_histogram(___)
7371
```
7472

7573
```{r histo_h3-hint-2}
76-
chart(biometry, formula = ~ NUM | FACTOR) +
74+
chart(data = biometry, ~ NUM | FACTOR) +
7775
geom_histogram(bins = ___)
7876
7977
#### Attention : solution dans le 'hint' suivant! ####
8078
```
8179

8280
```{r histo_h3-solution}
83-
chart(biometry, formula = ~ age | gender) +
81+
chart(data = biometry, ~ age | gender) +
8482
geom_histogram(bins = 30)
8583
```
8684

@@ -93,29 +91,29 @@ grade_code("Vous venez de réaliser votre premier histogramme !")
9391
Reproduisez le graphique suivant qui représente la répartition de la densité de la hauteur (`height`) en fonction du genre (`gender`) des individus présents dans le jeu de données `biometry`.
9492

9593
```{r density_intro}
96-
chart(biometry, formula = ~ height %fill=% gender) +
94+
chart(data = biometry, ~ height %fill=% gender) +
9795
geom_density()
9896
```
9997

10098
```{r density_h3, exercise = TRUE}
101-
chart(___, formula = ~ ___ ___ ___) +
99+
chart(data = ___, ~ ___ ___ ___) +
102100
___()
103101
```
104102

105103
```{r density_h3-hint-1}
106-
chart(DF, formula = ~ ___ %fill=% ___) +
104+
chart(data = DF, ~ ___ %fill=% ___) +
107105
geom_density()
108106
```
109107

110108
```{r density_h3-hint-2}
111-
chart(biometry, formula = ~ NUM %fill=% FACTOR) +
109+
chart(data = biometry, ~ NUM %fill=% FACTOR) +
112110
geom_density()
113111
114112
#### Attention : solution dans le 'hint' suivant! ####
115113
```
116114

117115
```{r density_h3-solution}
118-
chart(biometry, formula = ~ height %fill=% gender) +
116+
chart(data = biometry, ~ height %fill=% gender) +
119117
geom_density()
120118
```
121119

@@ -130,29 +128,29 @@ Reproduisez le graphique suivant qui représente la répartition de la densité
130128
**Nom du jeu de données et des variables importantes**
131129

132130
```{r violin_intro}
133-
chart(biometry, formula = height ~ gender) +
131+
chart(data = biometry, height ~ gender) +
134132
geom_violin()
135133
```
136134

137135
```{r violin_h3, exercise = TRUE}
138-
chart(___, formula = ___ ~ ___) +
136+
chart(data = ___, ___ ~ ___) +
139137
___()
140138
```
141139

142140
```{r violin_h3-hint-1}
143-
chart(DF, formula = ___ ~ ___) +
141+
chart(data = DF, ___ ~ ___) +
144142
geom_violin()
145143
```
146144

147145
```{r violin_h3-hint-2}
148-
chart(biometry, formula = NUM ~ FACTOR) +
146+
chart(data = biometry, NUM ~ FACTOR) +
149147
geom_violin()
150148
151149
#### Attention : solution dans le 'hint' suivant! ####
152150
```
153151

154152
```{r violin_h3-solution}
155-
chart(biometry, formula = height ~ gender) +
153+
chart(data = biometry, height ~ gender) +
156154
geom_violin()
157155
```
158156

@@ -178,33 +176,33 @@ Reproduisez le graphique suivant qui représente la répartition de taille (`siz
178176
**Nom du jeu de données et des variables importantes**
179177

180178
```{r violin2_intro}
181-
chart(copepoda, size ~ class %fill=% class) +
179+
chart(data = copepoda, size ~ class %fill=% class) +
182180
geom_violin(show.legend = FALSE) +
183181
coord_flip()
184182
```
185183

186184
```{r violin2_h3, exercise = TRUE}
187-
chart(___, ___ ~ ___ ___ ___) +
185+
chart(data = ___, ___ ~ ___ ___ ___) +
188186
geom_violin(show.legend = ___) +
189187
___
190188
```
191189

192190
```{r violin2_h3-hint-1}
193-
chart(DF, ___ ~ ___ %fill=% ___) +
191+
chart(data = DF, ___ ~ ___ %fill=% ___) +
194192
geom_violin(show.legend = ___) +
195193
___
196194
```
197195

198196
```{r violin2_h3-hint-2}
199-
chart(biometry, NUM ~ FACTOR %fill=% FACTOR) +
197+
chart(data = biometry, NUM ~ FACTOR %fill=% FACTOR) +
200198
geom_violin(show.legend = FALSE) +
201199
___
202200
203201
#### Attention : solution dans le 'hint' suivant! ####
204202
```
205203

206204
```{r violin2_h3-solution}
207-
chart(copepoda, size ~ class %fill=% class) +
205+
chart(data = copepoda, size ~ class %fill=% class) +
208206
geom_violin(show.legend = FALSE) +
209207
coord_flip()
210208
```
@@ -218,33 +216,33 @@ grade_code("Et une nouvelle fonction de plus pour améliorer la représentation
218216
Reproduisez le graphique suivant qui représente la répartition de taille (`size`) en fonction de la classe (`class`) des copépodes présents dans le jeu de données `copepoda` en utilisant la fonction `geom_density_ridges()` du package `ggridges`. Masquez la légende en utilisant l'argument `show.legend`
219217

220218
```{r ggridges_intro}
221-
chart(copepoda, class ~ size %fill=% class) +
219+
chart(data = copepoda, class ~ size %fill=% class) +
222220
ggridges::geom_density_ridges(show.legend = FALSE)
223221
```
224222

225223
```{r ggridges_h3, exercise = TRUE}
226224
library(ggridges)
227-
chart(___, ___ ~ ___ ___ ___) +
225+
chart(data = ___, ___ ~ ___ ___ ___) +
228226
___(___)
229227
```
230228

231229
```{r ggridges_h3-hint-1}
232230
library(ggridges)
233-
chart(DF, ___ ~ ___ %fill=% ___) +
231+
chart(data = DF, ___ ~ ___ %fill=% ___) +
234232
geom_density_ridges(___)
235233
```
236234

237235
```{r ggridges_h3-hint-2}
238236
library(ggridges)
239-
chart(copepoda, FACTOR ~ NUM %fill=% FACTOR) +
237+
chart(data = copepoda, FACTOR ~ NUM %fill=% FACTOR) +
240238
geom_density_ridges(show.legend = ___)
241239
242240
#### Attention : solution dans le 'hint' suivant! ####
243241
```
244242

245243
```{r ggridges_h3-solution}
246244
library(ggridges)
247-
chart(copepoda, class ~ size %fill=% class) +
245+
chart(data = copepoda, class ~ size %fill=% class) +
248246
geom_density_ridges(show.legend = FALSE)
249247
```
250248

@@ -257,27 +255,27 @@ grade_code("Félicitation ! Vous maitrisez un nouveau type de graphique.")
257255
Reproduisez le graphique suivant qui représente la répartition de taille (`size`) en fonction de la classe (`class`) du zooplancton présent dans le jeu de données `zooplankton` en utilisant la fonction `geom_density_ridges()` du package `ggridges`.
258256

259257
```{r ggridges2_intro}
260-
chart(zooplankton, class ~ size) +
258+
chart(data = zooplankton, class ~ size) +
261259
ggridges::geom_density_ridges()
262260
```
263261

264262
```{r ggridges2_h2, exercise = TRUE}
265263
library(ggridges)
266-
chart(___, ___ ~ ___) +
264+
chart(data = ___, ___ ~ ___) +
267265
___()
268266
```
269267

270268
```{r ggridges2_h2-hint}
271269
library(ggridges)
272-
chart(DF, FACTOR ~ NUM) +
270+
chart(data = DF, FACTOR ~ NUM) +
273271
geom_density_ridges()
274272
275273
#### Attention : solution dans le 'hint' suivant! ####
276274
```
277275

278276
```{r ggridges2_h2-solution}
279277
library(ggridges)
280-
chart(zooplankton, class ~ size) +
278+
chart(data = zooplankton, class ~ size) +
281279
geom_density_ridges()
282280
```
283281

@@ -299,29 +297,29 @@ Intéressez vous au jeu de données sur la biométrie d'oursin ci-dessous.
299297
À partir du jeu de données `urchin`, reproduisez le graphique suivant qui représente la variation de la taille (`height`) en fonction de la masse (`weight`) des oursins. L'orgine (`origin`) de ces derniers est mis en évidence par la couleur.
300298

301299
```{r np_intro}
302-
chart(urchin, height ~ weight %col=% origin) +
300+
chart(data = urchin, height ~ weight %col=% origin) +
303301
geom_point()
304302
```
305303

306304
```{r np_h3, exercise = TRUE}
307-
chart(___, ___ ~ ___ ___ ___) +
305+
chart(data = ___, ___ ~ ___ ___ ___) +
308306
___()
309307
```
310308

311309
```{r np_h3-hint-1}
312-
chart(DF, ___ ~ ___ %col=% ___) +
310+
chart(data = DF, ___ ~ ___ %col=% ___) +
313311
geom_point()
314312
```
315313

316314
```{r np_h3-hint-2}
317-
chart(urchin, NUM ~ NUM %col=% FACTOR) +
315+
chart(data = urchin, NUM ~ NUM %col=% FACTOR) +
318316
geom_point()
319317
320318
#### Attention : solution dans le 'hint' suivant! ####
321319
```
322320

323321
```{r np_h3-solution}
324-
chart(urchin, height ~ weight %col=% origin) +
322+
chart(data = urchin, height ~ weight %col=% origin) +
325323
geom_point()
326324
```
327325

@@ -334,34 +332,33 @@ grade_code("C'est parfait ! Vous vous souvenez comment on fait un graphique en n
334332
À partir du jeu de données `urchin`, reproduisez le graphique suivant qui représente la variation de la taille (`height`) en fonction de la masse (`weight`) des oursins. L'orgine (`origin`) et le sexe (`sex`) de ces derniers sont mis en évidence par la couleur et la forme, respectivement.
335333

336334
```{r np2_intro}
337-
chart(urchin, height ~ weight %col=% origin %shape=% sex) +
335+
chart(data = urchin, height ~ weight %col=% origin %shape=% sex) +
338336
geom_point()
339337
```
340338

341339
```{r np2_h3, exercise = TRUE}
342340
# Utiliser la couleur en tant que premier argument et la forme en second
343-
___(___, ___ ~ ___ ___ ___ ___ ___) +
341+
___(data = ___, ___ ~ ___ ___ ___ ___ ___) +
344342
___()
345343
```
346344

347345
```{r np2_h3-hint-1}
348346
# Utiliser la couleur en tant que premier argument et la forme en second
349-
chart(DF, ___ ~ ___ %col=% ___ %shape=% ___) +
347+
chart(data = DF, ___ ~ ___ %col=% ___ %shape=% ___) +
350348
geom_point()
351349
```
352350

353351
```{r np2_h3-hint-2}
354352
# Utiliser la couleur en tant que premier argument et la forme en second
355-
chart(urchin, NUM ~ NUM %col=% FACTOR %shape=% FACTOR) +
353+
chart(data = urchin, NUM ~ NUM %col=% FACTOR %shape=% FACTOR) +
356354
geom_point()
357355
#### Attention : solution dans le 'hint' suivant! ####
358356
```
359357

360358
```{r np2_h3-solution}
361359
# Utiliser la couleur en tant que premier argument et la forme en second
362-
chart(urchin, height ~ weight %col=% origin %shape=% sex) +
360+
chart(data = urchin, height ~ weight %col=% origin %shape=% sex) +
363361
geom_point()
364-
365362
```
366363

367364
```{r np2_h3-check}

0 commit comments

Comments
 (0)