Exercises for Week 3

Data and Computing Fundamentals

Narrow Data Exercises

In the Gapminder\TotalPopulation.csv data …

In the Gapminder\LandArea.csv data …

Narrow to Wide

Use subset() and join() to create a new data frame that has the country's population in 1990 as one variable and the population in 2010 as another variable.

pop90 = subset(pop, Year == 1990)
## Error: object 'pop' not found
pop10 = subset(pop, Year == 2010)
## Error: object 'pop' not found
allpop = join(pop90, pop10)
## Error: object 'pop10' not found

Quantitative to Categorical

Map Exercises

In each R chunk, include the commands needed to pre-process the data, e.g., groupBy, join, and transform. Then, use mWorldMap() to generate a map command interactively. Then add the map command to your R chunk. Don't use mWorldMap() in this document.

Make a map of per-country CO_2 emissions.

Make a map of per-country CO_2 emissions per capita.

Make a map of per-country CO_2 emissions per unit of GDP.

Make a map showing which countries have more than doubled in population since 1960.

Make a bubble map showing population as the size of the bubble and fertility as the color.

Pick a Gapminder variable. Make a map that displays which countries have data over a wide range of years and which have data only recently. Hint: min(Year)