The aim of this activity is to perform convenient visualization for data describing the evolution of wages and wheat price for English workers from the 16th to the 19th century.
Ceci est un document R markdown que vous pouvez aisément exporter au format HTML, PDF, et MS Word. Pour plus de détails sur R Markdown consultez <http://rmarkdown.rstudio.com>.
Lorsque vous cliquerez sur le bouton **Knit** ce document sera compilé afin de ré-exécuter le code R et d'inclure les résultats dans un document final. Comme nous vous l'avons montré dans la vidéo, on inclue du code R de la façon suivante:
<!--
library(reshape2)
library(Hmisc)
-->
We will need to use the following libraries:
```{r, results=FALSE, message=FALSE}
# The environment
library(tidyverse)
library(ggplot2)
library(reshape2)
library(Hmisc)
```
## Build the data frame
From the following link we have downloaded the data we are going to work with in the form of a csv file, and make it into data/ forlder: <https://raw.githubusercontent.com/vincentarelbundock/Rdatasets/master/csv/HistData/Wheat.csv>
From the following link we have downloaded the data we are going to work with in the form of a csv file, and make it into **data/** folder: <https://raw.githubusercontent.com/vincentarelbundock/Rdatasets/master/csv/HistData/Wheat.csv>
<!-- describe(df) -->
We assign it to a data frame as follows:
We build the data frame as follows, and we print a couple of rows to have a look at its structure:
```{r, message=FALSE}
df <- read.csv("data/Wheat.csv",header=T)
df[c(1,2),]
...
...
@@ -41,14 +40,47 @@ df[c(1,2),]
## Clean the data frame
We observe that the first column indicates a sort of an identifier for each data sample. This is not an interesting parameter, so we can simply omit it:
```{r, message=FALSE}
#only keep columns from 2 to 4 (column 1 is omitted)
#only keep columns from 2 to 4 (column 1 is omitted)
df <- df[c(2:4)]
df[c(1,2),]
```
## Plotting
## Reproducing Playfair's graph
**!!TODO : perform required transformations in terms of wheat-price & salary**