carpentries-incubator / open-science-with-r

Carpentry-style lesson on how to use R, RStudio together with git & Github to promote Open Science practices.
https://carpentries-incubator.github.io/open-science-with-r/
Other
8 stars 13 forks source link

miss a codind part in an exercice #6

Open azancarini opened 4 years ago

azancarini commented 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:

  1. loops through countries in Europe only.
  2. plots the cumulative mean gdpPercap (Hint: Use the Data Wrangling Cheatsheet!)
  3. 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)

mgalland commented 3 years ago

@all-contributors add @azancarini for lesson review

allcontributors[bot] commented 3 years ago

@mgalland

I've put up a pull request to add @azancarini! :tada: