Open azancarini opened 4 years ago
For the exercice on Europe, miss the filtering part of Europe country and create the list of countries
The code should be the following one:
Exercise Modify our for loop so that it: loops through countries in Europe only. plots the cumulative mean gdpPercap (Hint: Use the Data Wrangling Cheatsheet!) saves them to a new subfolder inside the (recreated) figures folder called "Europe". Solution dir.create("figures") dir.create("figures/Europe") ## create a list of countries. Calculations go here, not in the for loop gap_europe <- gapminder %>% filter(continent == "Europe") %>% mutate(gdpPercap_cummean = dplyr::cummean(gdpPercap)) country_list <- unique(gap_europe$country)
Modify our for loop so that it:
Solution dir.create("figures") dir.create("figures/Europe") ## create a list of countries. Calculations go here, not in the for loop gap_europe <- gapminder %>% filter(continent == "Europe") %>% mutate(gdpPercap_cummean = dplyr::cummean(gdpPercap)) country_list <- unique(gap_europe$country)
dir.create("figures") dir.create("figures/Europe")
dir.create("figures")
dir.create("figures/Europe")
## create a list of countries. Calculations go here, not in the for loop gap_europe <- gapminder %>% filter(continent == "Europe") %>% mutate(gdpPercap_cummean = dplyr::cummean(gdpPercap))
## create a list of countries. Calculations go here, not in the for loop
gap_europe <- gapminder %>%
filter(continent == "Europe") %>%
mutate(gdpPercap_cummean = dplyr::cummean(gdpPercap))
country_list <- unique(gap_europe$country)
@all-contributors add @azancarini for lesson review
@mgalland
I've put up a pull request to add @azancarini! :tada:
For the exercice on Europe, miss the filtering part of Europe country and create the list of countries
The code should be the following one: