Chapter 3 create data

gdp <- gapminder %>% filter(year==“2007”) %>% # subset rows dplyr::select(-year) %>% # subset columns (here remove year with minus sign) arrange(desc(pop)) %>% # arrange rows in descending order of pop mutate(country = factor(country, country)) # create a new variable country