開始使用免費開始

每日圖表

現在來查看每一天的搭乘次數與小時的關係。首先,我們會為資料集中第一個完整月份(5 月)建立摘要資料集並加以檢視。

本練習屬於課程

使用 R 的 Trelliscope 視覺化巨量資料

檢視課程

練習說明

  • 將資料篩選為 5 月(使用 start_mon
  • 針對 start_daystart_hodmembership 的每一種組合計算搭乘次數
  • 使用散點繪製「搭乘次數 vs. 小時」,並依 membership 以顏色區分點
  • 針對 start_day 使用分面,套用 facet_wrap(),並指定 7 欄以對齊星期

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

library(dplyr)
library(ggplot2)

# Compute daily_may
daily_may <- bike %>%
  filter(___) %>%
  group_by(___) %>%
  summarise(n = ___)

# Plot the result
ggplot(daily_may, aes(___, ___, color = ___)) +
  ___ +
  ___
編輯並執行程式碼