Skip to content

Commit

Permalink
Update the naming of challenges and add missing code chunk labels
Browse files Browse the repository at this point in the history
  • Loading branch information
cforgaci committed May 1, 2024
1 parent a6368c9 commit 9748ae1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion episodes/02-data-structures.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ abcd_vector

::::::::::::::::::::::::::::::::::::: challenge

### Exercise
### Challenge: combining vectors

Combine the `abcd_vector` with the `numeric_vector` in R. What is the data type of this new vector and why?

Expand Down
8 changes: 4 additions & 4 deletions episodes/03-explore-data.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ In each line after a `$` sign, we see the name of each column, its type and firs
There are multiple ways to explore a data set. Here are just a few examples:


```{r}
```{r examine-data}
head(gapminder) # shows first 6 rows of the data set
Expand Down Expand Up @@ -159,7 +159,7 @@ First we define data set, then - with the use of pipe we pass it on to the `sele
We already know how to select only the needed columns. But now, we also want to filter the rows of our data set via certain conditions with `filter()` function. Instead of doing it in separate steps, we can do it all together.

In the `gapminder` data set, we want to see the results from outside of Europe for the 21st century.
```{r}
```{r filter-data}
year_country_gdp_euro <- gapminder %>%
filter(continent != "Europe" & year >= 2000) %>%
select(year, country, gdpPercap)
Expand All @@ -170,7 +170,7 @@ head(year_country_gdp_euro)

::: challenge

## Exercise 1
## Challenge: filtered data frame

Write a single command (which can span multiple lines and includes pipes) that will produce a data frame that has the values for life expectancy, country and year, only for Eurasia. How many rows does your data frame have and why?

Expand Down Expand Up @@ -201,7 +201,7 @@ gapminder %>% # select the dataset

::: challenge

## Exercise 2
## Challenge: longest and shortest life expectancy

Calculate the average life expectancy per country. Which country has the longest average life expectancy and which has the shortest average life expectancy?

Expand Down

0 comments on commit 9748ae1

Please sign in to comment.