Aan de slagGa gratis aan de slag

Saving plots as variables

Plots can be saved as variables, which can be added to later on using the + operator. This is really useful if you want to make multiple related plots from a common base.

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.

# Draw a ggplot
plt_price_vs_carat <- ___(
  # Use the diamonds dataset
  ___,
  # For the aesthetics, map x to carat and y to price
  ___(___, ___)
)

# Add a point layer to plt_price_vs_carat
___ + ___
Code bewerken en uitvoeren