Skip to content

Commit

Permalink
fix manuscript skeleton to match manuscript-inline
Browse files Browse the repository at this point in the history
  • Loading branch information
fmichonneau committed Jun 2, 2015
1 parent b64282e commit 3d305e8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion manuscript.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```{r setup, echo = FALSE, results='hide', message = FALSE, warning = FALSE}
opts_chunk$set(echo = FALSE)
knitr::opts_chunk$set(echo = FALSE)
invisible(sapply(list.files(path = "R", pattern = "R$", full.names = TRUE), source))
```

Expand Down Expand Up @@ -30,6 +30,7 @@ the five continents.
gdp <- gather_gdp_data()
latest_lifeExp <- get_latest_lifeExp(gdp)
mean_lifeExp <- get_mean_lifeExp(gdp)
coef_before_after <- get_coef_before_after(mean_lifeExp, break_year)
```


Expand All @@ -56,6 +57,13 @@ and `r break_year`-`r max(gdp$year)`.
plot_change_trend(mean_lifeExp, break_year)
```

```{r change-trend}
change_trend <- coef_before_after %>% group_by(continent) %>% summarize(diff = trend[2] - trend[1])
largest_neg_change_index <- which.min(change_trend$diff)
largest_pos_change_index <- which.max(change_trend$diff)
least_change_index <- which.min(abs(change_trend$diff))
```

The largest negative change is observed for `r change_trend$continent[largest_neg_change_index]` with a
decrease of `r change_trend$diff[largest_neg_change_index]`.year<sup>-1</sup>
between the two time periods; while `r change_trend$continent[largest_pos_change_index]`
Expand Down

0 comments on commit 3d305e8

Please sign in to comment.