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.
Bu egzersiz
Introduction to Data Visualization with ggplot2
kursunun bir parçasıdırUygulamalı interaktif egzersiz
Bu örnek kodu tamamlayarak bu egzersizi bitirin.
# 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
___ + ___