MulaiMulai sekarang secara 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.

Latihan ini adalah bagian dari kursus

Introduction to Data Visualization with ggplot2

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# 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
___ + ___
Edit dan Jalankan Kode