Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Imports:
ggrepel,
maps,
mapproj,
MASS,
gapminder,
forcats,
mgcv,
Expand Down
4 changes: 2 additions & 2 deletions inst/tutorials/01-bar-charts_en/01-bar-charts.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ This tutorial will show you how to make and enhance **bar charts** with the ggpl
* use **position adjustments**
* use **facets** to create subplots

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}.
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"}.

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

## Bar Charts

### How to make a bar chart

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.
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.

```{r out.width = "80%"}
ggplot(data = diamonds) +
Expand Down
2 changes: 1 addition & 1 deletion inst/tutorials/01-bar-charts_fr/01-bar-charts-fr.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Ce module va vous montrer comment créer et mettre en valeur des **diagrammes en

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

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}.
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"}.

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ This tutorial will show you how to explore your data in a systematic way, a task
* Practice finding patterns in data
* Get tips about how to use different types of plots to explore data

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}.
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"}.

## Exploratory Data Analysis

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

```{r echo = FALSE, out.width = "100%"}
ggplot(mpg) +
ggplot(data = mpg) +
aes(reorder(class, hwy, median), hwy) +
geom_boxplot() +
ggtitle("Pickup trucks and SUVs display the lowest fuel efficiency") +
Expand Down
8 changes: 4 additions & 4 deletions inst/tutorials/01-reshape-data_en/01-Reshape-Data.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ On the contrary, data are said to be 'in a wide format' if the same observation
knitr::include_graphics("www/images/wide.png")
```

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.
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.

Click the Next Topic button to begin.

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

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

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

## Gathering columns

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

### A tidy version of

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

### pivot_longer()

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

### A tidy version of pollution

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

### pivot_wider()

Expand Down
6 changes: 3 additions & 3 deletions inst/tutorials/01-reshape-data_fr/01-Reshape-Data-fr.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Au contraire, des données sont dites 'dans un format large' (*wide* en anglais)
knitr::include_graphics("www/images/wide.png")
```

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.
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.

Cliquez sur le bouton pour commencer.

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

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

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

## Rassembler des colonnes

Expand Down Expand Up @@ -631,7 +631,7 @@ prenoms |>
group_by(year, sex) |>
summarise(total = sum(n)) |>
ggplot() +
aes(year, n, color = sex)+
aes(year, total, color = sex)+
geom_line()
```

Expand Down
4 changes: 2 additions & 2 deletions inst/tutorials/01-tibbles_en/01-tibbles.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ In the tutorials, we'll use a dataset named `babynames`, which comes in a packag

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

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!
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!

Click the Next Topic button to begin.

Expand Down Expand Up @@ -168,7 +168,7 @@ View(babynames)

### The tidyverse

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.
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.

### The tidyverse package

Expand Down
6 changes: 3 additions & 3 deletions inst/tutorials/01-tibbles_fr/01-tibbles-fr.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ Dans ce module, vous allez explorer la popularité de différents prénoms au fi

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.

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.
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.

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

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.
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.

Cliquez sur le bouton "Suivant" pour commencer.

Expand Down Expand Up @@ -157,7 +157,7 @@ View(prenoms)

### Le tidyverse

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.
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.

### Le package {tidyverse}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Ce module va vous montrer comment explorer vos données de façon systématique

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

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}.
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"}.

## Analyse exploratoire de donnees

Expand Down Expand Up @@ -288,7 +288,7 @@ diamonds |>
geom_tile() +
ggtitle("Gradient de couleur vs. qualité de la taille pour 53940 diamants")

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

```{r echo = FALSE, out.width = "100%"}
ggplot(mpg) +
ggplot(data = mpg) +
aes(reorder(class, hwy, median), hwy) +
geom_boxplot() +
ggtitle("Pickup et SUV ont la consommation la plus efficace") +
Expand Down
6 changes: 3 additions & 3 deletions inst/tutorials/02-isolating_en/02-isolating.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ In this case study, you will explore the popularity of your own name over time.
* `arrange()`, which lets you reorder the rows in your data
* `|>`, which organizes your code into reader-friendly "pipes"

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.
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.

Click the Next Topic button to begin.

Expand Down Expand Up @@ -69,7 +69,7 @@ But before you do, you will need to trim down `babynames`. At the moment, there
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.

```{r out.width = "60%", cached = TRUE}
ggplot(babynames) +
ggplot(data = babynames) +
aes(x = year, y = prop) +
geom_point() +
labs(title = "Popularity of every name in the data set")
Expand All @@ -89,7 +89,7 @@ babynames |>
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.

```{r out.width = "60%", cached = TRUE}
ggplot(babynames) +
ggplot(data = babynames) +
aes(x = year, y = prop) +
geom_line() +
labs(title = "Popularity of every name in the data set")
Expand Down
6 changes: 3 additions & 3 deletions inst/tutorials/02-isolating_fr/02-isolating-fr.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Dans cette étude de cas, vous allez explorer la popularité de votre propre pr
* `arrange()`, permet de réorganiser les lignes de vos données
* `|>`, organise votre code en "pipes" ("flux" de traitement) faciles à lire

Ce module de cours utilise les [packages de base du tidyverse](http://tidyverse.org/){target="_blank}, notamment `{ggplot2}`, `{tibble}` et `{dplyr}`, ainsi que le package `{prenoms}`. Tous ces packages ont été préinstallés et préchargés.
Ce module de cours utilise les [packages de base du tidyverse](http://tidyverse.org/){target="_blank"}, notamment `{ggplot2}`, `{tibble}` et `{dplyr}`, ainsi que le package `{prenoms}`. Tous ces packages ont été préinstallés et préchargés.

Cliquez sur le bouton "Suivant" pour commencer.

Expand Down Expand Up @@ -85,7 +85,7 @@ Avant d'afficher les informations à propos d'un autre prénom, vous devrez réd
Voyons la façon dont nous avons créé le graphique ci-dessus : nous avons commencé avec le jeu de données entier qui, si il était affiché sous la forme d'un nuage de points, aurait ressemblé à ceci :

```{r out.width = "60%", cached = TRUE}
ggplot(prenoms) +
ggplot(data = prenoms) +
aes(x = year, y = prop) +
geom_point() +
labs(title = "Popularité de chaque prénom dans le jeu de données")
Expand All @@ -105,7 +105,7 @@ prenoms |>
Si nous avions sauté cette étape, notre graphique linéaire aurait connecté tous les points du jeu de données entier, créant un graphique non informatif.

```{r out.width = "60%", cached = TRUE}
ggplot(prenoms) +
ggplot(data = prenoms) +
aes(x = year, y = prop) +
geom_line() +
labs(title = "Popularité de chaque prénom du jeu de données")
Expand Down
4 changes: 2 additions & 2 deletions inst/tutorials/02-separate-columns_en/02-separate-columns.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ This tutorial will teach you two tools that you can use to tidy this type of dat

It ends with a case study that requires you to use all of the tidy tools to wrangle a messy real world data set.

This tutorial uses the [core tidyverse packages](http://tidyverse.org/){target="_blank}, including tidyr. All of these packages have been pre-installed and pre-loaded for your convenience.
This tutorial uses the [core tidyverse packages](http://tidyverse.org/){target="_blank"}, including tidyr. All of these packages have been pre-installed and pre-loaded for your convenience.

Click the Next Topic button to begin.

Expand Down Expand Up @@ -332,7 +332,7 @@ In the case study that follows, you will do just that. You will also practice us

### who

The `who` data set contains a subset of data from the World Health Organization Global Tuberculosis Report, available [here](http://www.who.int/tb/country/data/download/en/){target="_blank}.
The `who` data set contains a subset of data from the World Health Organization Global Tuberculosis Report, available [here](http://www.who.int/tb/country/data/download/en/){target="_blank"}.

In its original format, the data is very untidy

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Ce module vous apprendra deux outils que vous pouvez utiliser pour réordonner c

Le module se termine par une étude de cas qui vous obligera à utiliser tous les outils de mise en ordre des données pour appréhender un jeu de données réelles désordonnées.

Ce module utilise les [packages de base du tidyverse](http://tidyverse.org/){target="_blank}, notamment {tidyr}. Tous ces packages ont été préinstallés et préchargés.
Ce module utilise les [packages de base du tidyverse](http://tidyverse.org/){target="_blank"}, notamment {tidyr}. Tous ces packages ont été préinstallés et préchargés.

Cliquez sur le bouton "Suivant" pour commencer.

Expand Down Expand Up @@ -304,7 +304,7 @@ Dans l'étude de cas qui suit, c'est justement ce que vous allez faire. Vous vou

### who

Le jeu de données `who` contient un sous-ensemble de données du rapport mondial sur la tuberculose de l'Organisation Mondiale de la Santé (OMS). Il est disponible [ici](http://www.who.int/tb/country/data/download/en/){target="_blank}.
Le jeu de données `who` contient un sous-ensemble de données du rapport mondial sur la tuberculose de l'Organisation Mondiale de la Santé (OMS). Il est disponible [ici](http://www.who.int/tb/country/data/download/en/){target="_blank"}.

Dans leur format d'origine, les données sont très désordonnées

Expand Down
Loading