Replace exercice_en.Rmd

parent f847b2ee
......@@ -78,7 +78,7 @@ ggplot(df, aes(x=Year)) +
## 2. Alternative representation
First, we represent the data as simple dots for both wages and wheat price.
As it is difficult to see the pattern for the wheat values evolution, we use the `stat_smooth()` function that shows a smoothed mean.
As it is difficult to see the pattern for the wheat values evolution, we use the `stat_smooth()` function that shows a smoothed mean (with a confidence level of 70%).
```{r, message=FALSE}
# Set color parameters
wages_color <- "#ff5733"
......@@ -91,7 +91,7 @@ ggplot(df, aes(x=Year)) +
geom_point( aes(y=Wheat/1.5), size = 0.7, color = wheat_color) +
geom_line( aes(y=Wages), size = 0.3, color = wages_color, linetype="dashed") +
geom_line( aes(y=Wheat/1.5), size = 0.3, color = wheat_color, linetype="dashed") +
stat_smooth(aes(y=Wheat/1.5), level = 0, size=0.6, color=wheat_color_trans) +
stat_smooth(aes(y=Wheat/1.5), level = 0.7, size=0.6, color=wheat_color_trans) +
# Custom the Y scales:
scale_y_continuous(
......@@ -108,6 +108,21 @@ ggplot(df, aes(x=Year)) +
```
## 3. Another Representation without an explicit time axis
TBD
```{r, message=FALSE}
ggplot(df, aes(x=Wages, y=Wheat)) +
geom_area( size = 0.5, alpha=0.5,
linetype="dashed",
color = "#ff3333",
fill = "#3399e6" ) +
geom_point( size = .7, shape = 4 ) +
xlim(min((na.omit(df))$Wages), max((na.omit(df))$Wages)) +
labs(title = "Evolution Wheat price with respect to Salary of English workers (16th to 19th century)") +
theme(plot.title = element_text(hjust = 0.5))
```
### Comments
TBD
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment