Session Ready
Exercise

The Spanish silver production

Luckily for us data wizards, the Spaniards kept very detailed records on how much silver they were producing during the colonial era (1720 - 1800). Let's explore their efficiency over the years using some visualizations.

You'll be working with the silver data frame, that's available in your workspace. It contains 81 observations (1 for each year between 1620 and 1800) and two variables: year and silver_minted. You'll create two graphs: the first one shows the amount of minted silver over time. The second one shows the cumulative amount of silver minted year of year.

Instructions
100 XP
  • Finish the first ggplot() command to plot the amount of silver minted each year:
    • Map year onto x and silver_minted onto y.
    • Inside geom_area(), set alpha = 0.3.
  • Edit the command that adds a column cum_silver_minted to silver. Use cumsum() on the silver_minted column of silver.
  • Finish the second ggplot() command to plot the cumulative amount of silver minted over time:
    • Map year onto x and cum_silver_minted onty y.
    • Inside geom_area(), set the alpha to 0.5.