BaşlayınÜcretsiz Başlayın

Adding geometries

The diamonds dataset contains details of 1,000 diamonds. Among the variables included are carat (a measurement of the diamond's size) and price.

You'll use two common geom layer functions:

  • geom_point() adds points (as in a scatter plot).
  • geom_smooth() adds a smooth trend curve.

As you saw previously, these are added using the + operator.

ggplot(data, aes(x, y)) +
  geom_*()

Where * is the specific geometry needed.

Bu egzersiz

Introduction to Data Visualization with ggplot2

kursunun bir parçasıdır
Kursu Görüntüle

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Explore the diamonds data frame with str()
___
Kodu Düzenle ve Çalıştır