Skip to content
This repository was archived by the owner on Feb 11, 2026. It is now read-only.

miss a codind part in an exercice #6

@azancarini

Description

@azancarini

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions