Multiple time series
We already saw how the form of your data affects how you can plot it. Let's explore that further with multiple time series. Here, it's important that all lines are on the same scale, and if possible, on the same plot.
fish.species
contains the global capture rates of seven salmon species from 1950–2010. Each variable (column) is a Salmon species and each observation (row) is one year. fish.tidy
contains the same data, but in three columns: Species
, Year
, and Capture
(i.e. one variable per column).
This exercise is part of the course
Introduction to Data Visualization with ggplot2
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Plot the Rainbow Salmon time series
ggplot(___, aes(x = ___, y = ___)) +
___()