Aan de slagGa gratis aan de slag

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).

Deze oefening maakt deel uit van de cursus

Introduction to Data Visualization with ggplot2

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Plot the Rainbow Salmon time series
ggplot(___, aes(x = ___, y = ___)) +
  ___()
Code bewerken en uitvoeren