Skip to content

Commit c9fb550

Browse files
committed
Add bigger hint to challenge
1 parent e7c60be commit c9fb550

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

_episodes/07-notebooks.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,23 +159,25 @@ Take a look at the [DRYNotebook.Rmd](https://raw.githubusercontent.com/uomresear
159159

160160
> ## Challenge 3
161161
>
162-
> Modify your notebook to plot a line graph showing life expectancy over time, coloured by continent (you should have code to do this from the ggplot lesson).
162+
> Part 1: Modify your notebook to plot a line graph showing life expectancy over time, coloured by continent (you should have code to do this from the ggplot lesson).
163163
>
164-
> Modify the notebook to print something similar to the following paragraph:
164+
> Part 2: Modify the notebook to print something similar to the following paragraph:
165165
>
166166
> "In 2002, citizens of Japan had the longest average life expectancy in the world, at 82. By comparison, in United Kingdom, the average life expectancy was 78.471".
167167
>
168-
> You should pass the year we wish to calculate the life expectancies at, and the comparator country as parameters to your report.
168+
> You should pass the year we wish to calculate the life expectancies at (e.g. 2002), and the comparator country (e.g. United Kingdom) as parameters to your report.
169169
>
170-
> Hints: To calculate the country with the longest life expectancy use `arrange(desc())` to sort the data in descending order. The country with the longest life expectancy will then be first in the resulting tibble.
170+
> Hints: To calculate the country with the longest life expectancy use `arrange(desc())` to sort the data in descending order. The country with the longest life expectancy will then be first in the resulting tibble.
171171
>
172-
> You can extract a column from a tibble, as a vector using the `$` operator:
172+
> If you save the tibble containing the data sorted by age, you can then extract a column from it, as a vector using the `$` operator:
173173
>
174174
>
175175
> ~~~
176-
> gapminder$lifeExp
176+
> gapminderSorted$lifeExp
177177
> ~~~
178178
> {: .language-r}
179+
>
180+
> You can then use the indexing operator `[]` to get the value of the first element of this vector, which will be the largest age.
179181
>
180182
> > ## Solution
181183
> >

_episodes_rmd/07-notebooks.Rmd

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,21 +160,23 @@ Take a look at the [DRYNotebook.Rmd](https://raw.githubusercontent.com/uomresear
160160

161161
> ## Challenge 3
162162
>
163-
> Modify your notebook to plot a line graph showing life expectancy over time, coloured by continent (you should have code to do this from the ggplot lesson).
163+
> Part 1: Modify your notebook to plot a line graph showing life expectancy over time, coloured by continent (you should have code to do this from the ggplot lesson).
164164
>
165-
> Modify the notebook to print something similar to the following paragraph:
165+
> Part 2: Modify the notebook to print something similar to the following paragraph:
166166
>
167167
> "In 2002, citizens of Japan had the longest average life expectancy in the world, at 82. By comparison, in United Kingdom, the average life expectancy was 78.471".
168168
>
169-
> You should pass the year we wish to calculate the life expectancies at, and the comparator country as parameters to your report.
169+
> You should pass the year we wish to calculate the life expectancies at (e.g. 2002), and the comparator country (e.g. United Kingdom) as parameters to your report.
170170
>
171-
> Hints: To calculate the country with the longest life expectancy use `arrange(desc())` to sort the data in descending order. The country with the longest life expectancy will then be first in the resulting tibble.
171+
> Hints: To calculate the country with the longest life expectancy use `arrange(desc())` to sort the data in descending order. The country with the longest life expectancy will then be first in the resulting tibble.
172172
>
173-
> You can extract a column from a tibble, as a vector using the `$` operator:
173+
> If you save the tibble containing the data sorted by age, you can then extract a column from it, as a vector using the `$` operator:
174174
>
175175
> ```{r, eval=FALSE}
176-
> gapminder$lifeExp
176+
> gapminderSorted$lifeExp
177177
> ```
178+
>
179+
> You can then use the indexing operator `[]` to get the value of the first element of this vector, which will be the largest age.
178180
>
179181
> > ## Solution
180182
> >

0 commit comments

Comments
 (0)