Skip to content

Instantly share code, notes, and snippets.

@EvaMaeRey
Created November 13, 2019 00:11
Show Gist options
  • Select an option

  • Save EvaMaeRey/849827234ce5e3aa1d5f71922add0858 to your computer and use it in GitHub Desktop.

Select an option

Save EvaMaeRey/849827234ce5e3aa1d5f71922add0858 to your computer and use it in GitHub Desktop.
for RLadies Denver
library(tidyverse)
library(gapminder)
gapminder %>% # data from package
filter(year == 2002) -> # filtering
gapminder_2002 # saving subset object
gapminder_2002 %>%
filter(continent == "Europe") ->
gapminder_2002_europe
gapminder %>%
select(country, continent) %>%
distinct() %>%
group_by(continent) %>%
summarise(country_count = n()) ->
continent_aggregate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment