Skip to content

Commit e76ced3

Browse files
Merge pull request #38 from ThinkR-open/fix_12_2025
Improve learnrs
2 parents d81a701 + 121724d commit e76ced3

File tree

32 files changed

+82
-81
lines changed

32 files changed

+82
-81
lines changed

DESCRIPTION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Imports:
2929
ggrepel,
3030
maps,
3131
mapproj,
32+
MASS,
3233
gapminder,
3334
forcats,
3435
mgcv,

inst/tutorials/01-bar-charts_en/01-bar-charts.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ This tutorial will show you how to make and enhance **bar charts** with the ggpl
3030
* use **position adjustments**
3131
* use **facets** to create subplots
3232

33-
The tutorial is adapted from _R for Data Science_ by Hadley Wickham and Garrett Grolemund, published by O’Reilly Media, Inc., 2016, ISBN: 9781491910399. You can purchase the book at [shop.oreilly.com](http://shop.oreilly.com/product/0636920034407.do){target="_blank}.
33+
The tutorial is adapted from _R for Data Science_ by Hadley Wickham and Garrett Grolemund, published by O’Reilly Media, Inc., 2016, ISBN: 9781491910399. You can purchase the book at [shop.oreilly.com](http://shop.oreilly.com/product/0636920034407.do){target="_blank"}.
3434

3535
The tutorial uses the ggplot2 and dplyr packages, which have been pre-loaded for your convenience.
3636

3737
## Bar Charts
3838

3939
### How to make a bar chart
4040

41-
To make a bar chart with ggplot2, add `geom_bar()` to the [ggplot2 template](https://tutorials.shinyapps.io/02-Vis-Basics/){target="_blank}. For example, the code below plots a bar chart of the `cut` variable in the `diamonds` dataset, which comes with ggplot2.
41+
To make a bar chart with ggplot2, add `geom_bar()` to the [ggplot2 template](https://tutorials.shinyapps.io/02-Vis-Basics/){target="_blank"}. For example, the code below plots a bar chart of the `cut` variable in the `diamonds` dataset, which comes with ggplot2.
4242

4343
```{r out.width = "80%"}
4444
ggplot(data = diamonds) +

inst/tutorials/01-bar-charts_fr/01-bar-charts-fr.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Ce module va vous montrer comment créer et mettre en valeur des **diagrammes en
3131

3232
* utiliser des **facettes** pour créer des sous-graphiques.
3333

34-
Ce module est tiré du livre de _R for Data Science_ par Hadley Wickham et Garrett Grolemund, publié par O’Reilly Media, Inc., 2016, ISBN: 9781491910399. Vous pouvez obtenir le livre à ici : [shop.oreilly.com](http://shop.oreilly.com/product/0636920034407.do){target="_blank}.
34+
Ce module est tiré du livre de _R for Data Science_ par Hadley Wickham et Garrett Grolemund, publié par O’Reilly Media, Inc., 2016, ISBN: 9781491910399. Vous pouvez obtenir le livre à ici : [shop.oreilly.com](http://shop.oreilly.com/product/0636920034407.do){target="_blank"}.
3535

3636
Ce module utilise les packages {ggplot2} et {dplyr}, qui ont été pré-installés.
3737

inst/tutorials/01-exploratory-data-analysis_en/01-Exploratory-Data-Analysis.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ This tutorial will show you how to explore your data in a systematic way, a task
2929
* Practice finding patterns in data
3030
* Get tips about how to use different types of plots to explore data
3131

32-
The tutorial is excerpted from _R for Data Science_ by Hadley Wickham and Garrett Grolemund, published by O’Reilly Media, Inc., 2016, ISBN: 9781491910399. You can purchase the book at [shop.oreilly.com](http://shop.oreilly.com/product/0636920034407.do){target="_blank}.
32+
The tutorial is excerpted from _R for Data Science_ by Hadley Wickham and Garrett Grolemund, published by O’Reilly Media, Inc., 2016, ISBN: 9781491910399. You can purchase the book at [shop.oreilly.com](http://shop.oreilly.com/product/0636920034407.do){target="_blank"}.
3333

3434
## Exploratory Data Analysis
3535

@@ -301,7 +301,7 @@ Again, don't be concerned if you do not know how to make these graphs. For now,
301301
You can plot the relationship between one continuous and one categorical variable with a boxplot:
302302

303303
```{r echo = FALSE, out.width = "100%"}
304-
ggplot(mpg) +
304+
ggplot(data = mpg) +
305305
aes(reorder(class, hwy, median), hwy) +
306306
geom_boxplot() +
307307
ggtitle("Pickup trucks and SUVs display the lowest fuel efficiency") +

inst/tutorials/01-reshape-data_en/01-Reshape-Data.Rmd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ On the contrary, data are said to be 'in a wide format' if the same observation
8080
knitr::include_graphics("www/images/wide.png")
8181
```
8282

83-
This tutorial uses the [core tidyverse packages](http://tidyverse.org/){target="_blank}, including {ggplot2}, {dplyr}, and {tidyr}, as well as the `babynames` package. All of these packages have been pre-installed and pre-loaded for your convenience.
83+
This tutorial uses the [core tidyverse packages](http://tidyverse.org/){target="_blank"}, including {ggplot2}, {dplyr}, and {tidyr}, as well as the `babynames` package. All of these packages have been pre-installed and pre-loaded for your convenience.
8484

8585
Click the Next Topic button to begin.
8686

@@ -276,7 +276,7 @@ In the following sections, you will learn about the functions:
276276

277277
We'll come back to this later, but here's an overview of how these two functions work:
278278

279-
![](https://www.fromthebottomoftheheap.net/assets/img/posts/tidyr-longer-wider.gif){target="_blank}
279+
![](https://www.fromthebottomoftheheap.net/assets/img/posts/tidyr-longer-wider.gif){target="_blank"}
280280

281281
## Gathering columns
282282

@@ -304,7 +304,7 @@ question("What are the variables in cases?",
304304

305305
### A tidy version of
306306

307-
![](https://vimeo.com/229581273){target="_blank}
307+
![](https://vimeo.com/229581273){target="_blank"}
308308

309309
### pivot_longer()
310310

@@ -514,7 +514,7 @@ question("Which column in pollution contains the values associated with the key
514514

515515
### A tidy version of pollution
516516

517-
![](https://vimeo.com/229581273){target="_blank}
517+
![](https://vimeo.com/229581273){target="_blank"}
518518

519519
### pivot_wider()
520520

inst/tutorials/01-reshape-data_fr/01-Reshape-Data-fr.Rmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Au contraire, des données sont dites 'dans un format large' (*wide* en anglais)
6868
knitr::include_graphics("www/images/wide.png")
6969
```
7070

71-
Ce module utilise les [packages qui composent le coeur du tidyverse ](http://tidyverse.org/){target="_blank}, notamment {ggplot2}, {dplyr} et {tidyr}. Nous utiliserons également le package `{prenoms}` made in ThinkR (voir [ici](https://github.com/ThinkR-open/prenoms){target="_blank} pour l'installer). Tous ces packages ont été préinstallés et préchargés pour vous dans ce module. Nul besoin donc de les installer et les charger de nouveau.
71+
Ce module utilise les [packages qui composent le coeur du tidyverse ](http://tidyverse.org/){target="_blank"}, notamment {ggplot2}, {dplyr} et {tidyr}. Nous utiliserons également le package `{prenoms}` made in ThinkR (voir [ici](https://github.com/ThinkR-open/prenoms){target="_blank"} pour l'installer). Tous ces packages ont été préinstallés et préchargés pour vous dans ce module. Nul besoin donc de les installer et les charger de nouveau.
7272

7373
Cliquez sur le bouton pour commencer.
7474

@@ -263,7 +263,7 @@ Dans les sections suivantes, vous allez découvrir les fonctions :
263263

264264
Nous y reviendrons par la suite, mais voici un aperçu du fonctionnement de ces deux fonctions :
265265

266-
![](https://www.fromthebottomoftheheap.net/assets/img/posts/tidyr-longer-wider.gif){target="_blank}
266+
![](https://www.fromthebottomoftheheap.net/assets/img/posts/tidyr-longer-wider.gif){target="_blank"}
267267

268268
## Rassembler des colonnes
269269

@@ -631,7 +631,7 @@ prenoms |>
631631
group_by(year, sex) |>
632632
summarise(total = sum(n)) |>
633633
ggplot() +
634-
aes(year, n, color = sex)+
634+
aes(year, total, color = sex)+
635635
geom_line()
636636
```
637637

inst/tutorials/01-tibbles_en/01-tibbles.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ In the tutorials, we'll use a dataset named `babynames`, which comes in a packag
4747

4848
This tutorial introduces `babynames` as well as a new data structure that makes working with data in R easy: the tibble.
4949

50-
In addition to `babynames`, this tutorial uses the [core tidyverse packages](http://tidyverse.org/){target="_blank}, including ggplot2, tibble, and dplyr. All of these packages have been pre-installed for your convenience. But they haven't been pre-loaded---something you will soon learn more about!
50+
In addition to `babynames`, this tutorial uses the [core tidyverse packages](http://tidyverse.org/){target="_blank"}, including ggplot2, tibble, and dplyr. All of these packages have been pre-installed for your convenience. But they haven't been pre-loaded---something you will soon learn more about!
5151

5252
Click the Next Topic button to begin.
5353

@@ -168,7 +168,7 @@ View(babynames)
168168

169169
### The tidyverse
170170

171-
The tibble package is one of several packages that are known collectively as ["the tidyverse"](http://tidyverse.org){target="_blank}. Tidyverse packages share a common philosophy and are designed to work well together. For example, in this tutorial you will use the **tibble** package, the **ggplot2** package, and the **dplyr** package, all of which belong to the tidyverse.
171+
The tibble package is one of several packages that are known collectively as ["the tidyverse"](http://tidyverse.org){target="_blank"}. Tidyverse packages share a common philosophy and are designed to work well together. For example, in this tutorial you will use the **tibble** package, the **ggplot2** package, and the **dplyr** package, all of which belong to the tidyverse.
172172

173173
### The tidyverse package
174174

inst/tutorials/01-tibbles_fr/01-tibbles-fr.Rmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ Dans ce module, vous allez explorer la popularité de différents prénoms au fi
3535

3636
Ce sont quelques-unes des fonctions R les plus utiles pour la data science, et les modules qui suivent vous fourniront tout ce dont vous avez besoin pour apprendre à les manipuler.
3737

38-
Dans les modules, nous utiliserons un jeu de données nommé `prenoms`, qui est fourni dans le package également nommé **{prenoms}** made in ThinkR (voir [ici](https://github.com/ThinkR-open/prenoms){target="_blank} pour l'installer). Dans `prenoms`, vous trouverez des informations sur presque tous les prénoms donnés aux enfants en France métropolitaine depuis 1900.
38+
Dans les modules, nous utiliserons un jeu de données nommé `prenoms`, qui est fourni dans le package également nommé **{prenoms}** made in ThinkR (voir [ici](https://github.com/ThinkR-open/prenoms){target="_blank"} pour l'installer). Dans `prenoms`, vous trouverez des informations sur presque tous les prénoms donnés aux enfants en France métropolitaine depuis 1900.
3939

4040
Ce module présente `prenoms` ainsi qu'une nouvelle structure de données qui facilite l'utilisation des données dans R : le tibble.
4141

42-
En plus de `{prenoms}`, ce module utilise les [packages de base du tidyverse](http://tidyverse.org/){target="_blank}, notamment {ggplot2}, {tibble} et {dplyr}. Tous ces packages ont été préinstallés mais ils n'ont pas été préchargés.
42+
En plus de `{prenoms}`, ce module utilise les [packages de base du tidyverse](http://tidyverse.org/){target="_blank"}, notamment {ggplot2}, {tibble} et {dplyr}. Tous ces packages ont été préinstallés mais ils n'ont pas été préchargés.
4343

4444
Cliquez sur le bouton "Suivant" pour commencer.
4545

@@ -157,7 +157,7 @@ View(prenoms)
157157

158158
### Le tidyverse
159159

160-
Le package `{tibble}` est l'un des nombreux packages du ["tidyverse"](http://tidyverse.org){target="_blank}. Les packages du tidyverse partagent une philosophie commune et sont conçus pour bien fonctionner ensemble. Par exemple, dans ce module, vous utiliserez le package **{tibble}**, le package **{ggplot2}** et le package **{dplyr}**, qui appartiennent tous au tidyverse.
160+
Le package `{tibble}` est l'un des nombreux packages du ["tidyverse"](http://tidyverse.org){target="_blank"}. Les packages du tidyverse partagent une philosophie commune et sont conçus pour bien fonctionner ensemble. Par exemple, dans ce module, vous utiliserez le package **{tibble}**, le package **{ggplot2}** et le package **{dplyr}**, qui appartiennent tous au tidyverse.
161161

162162
### Le package {tidyverse}
163163

inst/tutorials/02-exploratory-data-analysis_fr/02-Exploratory-Data-Analysis-fr.Rmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Ce module va vous montrer comment explorer vos données de façon systématique
2929

3030
* Assimiler des astuces pour déterminer quel type de graphique doit être utilisé pour explorer les données
3131

32-
Ce module provient du livre _R for Data Science_ de Hadley Wickham et Garrett Grolemund, publié par O’Reilly Media, Inc., 2016, ISBN: 9781491910399. Vous pouvez vous procurer le livre à [shop.oreilly.com](http://shop.oreilly.com/product/0636920034407.do){target="_blank}.
32+
Ce module provient du livre _R for Data Science_ de Hadley Wickham et Garrett Grolemund, publié par O’Reilly Media, Inc., 2016, ISBN: 9781491910399. Vous pouvez vous procurer le livre à [shop.oreilly.com](http://shop.oreilly.com/product/0636920034407.do){target="_blank"}.
3333

3434
## Analyse exploratoire de donnees
3535

@@ -288,7 +288,7 @@ diamonds |>
288288
geom_tile() +
289289
ggtitle("Gradient de couleur vs. qualité de la taille pour 53940 diamants")
290290
291-
ggplot(diamonds) +
291+
ggplot(data = diamonds) +
292292
aes(color, cut) +
293293
geom_count() +
294294
ggtitle("Gradient de couleur vs. qualité de la taille pour 53940 diamants")
@@ -301,7 +301,7 @@ De nouveau, ne vous inquiétez pas de ne pas savoir comment faire ces graphiques
301301
Vous pouvez représenter la relation entre une variable continue et une variable catégorielle avec une boîte à moustaches (boxplot) :
302302

303303
```{r echo = FALSE, out.width = "100%"}
304-
ggplot(mpg) +
304+
ggplot(data = mpg) +
305305
aes(reorder(class, hwy, median), hwy) +
306306
geom_boxplot() +
307307
ggtitle("Pickup et SUV ont la consommation la plus efficace") +

inst/tutorials/02-isolating_en/02-isolating.Rmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ In this case study, you will explore the popularity of your own name over time.
3838
* `arrange()`, which lets you reorder the rows in your data
3939
* `|>`, which organizes your code into reader-friendly "pipes"
4040

41-
This tutorial uses the [core tidyverse packages](http://tidyverse.org/){target="_blank}, including ggplot2, tibble, and dplyr, as well as the `babynames` package. All of these packages have been pre-installed and pre-loaded for your convenience.
41+
This tutorial uses the [core tidyverse packages](http://tidyverse.org/){target="_blank"}, including ggplot2, tibble, and dplyr, as well as the `babynames` package. All of these packages have been pre-installed and pre-loaded for your convenience.
4242

4343
Click the Next Topic button to begin.
4444

@@ -69,7 +69,7 @@ But before you do, you will need to trim down `babynames`. At the moment, there
6969
To see what I mean, consider how I made the plot above: I began with the entire data set, which if plotted as a scatterplot would've looked like this.
7070

7171
```{r out.width = "60%", cached = TRUE}
72-
ggplot(babynames) +
72+
ggplot(data = babynames) +
7373
aes(x = year, y = prop) +
7474
geom_point() +
7575
labs(title = "Popularity of every name in the data set")
@@ -89,7 +89,7 @@ babynames |>
8989
If I had skipped this step, my line graph would've connected all of the points in the large data set, creating an uninformative graph.
9090

9191
```{r out.width = "60%", cached = TRUE}
92-
ggplot(babynames) +
92+
ggplot(data = babynames) +
9393
aes(x = year, y = prop) +
9494
geom_line() +
9595
labs(title = "Popularity of every name in the data set")

0 commit comments

Comments
 (0)