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).
Latihan ini adalah bagian dari kursus
Introduction to Data Visualization with ggplot2
Latihan interaktif praktis
Cobalah latihan ini dengan menyelesaikan kode contoh berikut.
# Plot the Rainbow Salmon time series
ggplot(___, aes(x = ___, y = ___)) +
___()