IniziaInizia gratis

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.

Questo esercizio fa parte del corso

Introduction to Data Visualization with ggplot2

Visualizza il corso

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# 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
___ + ___
Modifica ed esegui il codice