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

Distribution of cab fare amount

Let's learn about how much cab rides cost in NYC and look at a histogram of the total cab fare. Since the fare amount is likely to be highly skewed, we will plot it with the x-axis in the log scale.

The tx data set is preloaded for you.

Bu egzersiz

Visualizing Big Data with Trelliscope in R

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

Egzersiz talimatları

  • Plot the the distribution of the total cab fare,total_amount using geom_histogram().
  • In the last line, apply a log base 10 scale to the x-axis using scale_x_log10(). Note that you will receive a warning message about 62 data points that have a total fare of $0. These points are ignored since the logarithm is infinite.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

library(ggplot2)

# Create a histogram of total_amount
ggplot(___, aes(___)) +
  ___ +
  ___
Kodu Düzenle ve Çalıştır