開始使用免費開始

每日騎乘次數

製作一個摘要圖,呈現每日騎乘次數,並以上班日/週末日使用不同顏色區分。

本練習屬於課程

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

檢視課程

練習說明

  • 使用 group_by()summarise() 建立每日計數的資料集。以 start_day 分組,並記得同時保留變數 weekday
  • 繪製結果圖,使用點來呈現,將 y 軸設為騎乘次數、x 軸設為起始日期。依 weekday 變色點。

動手互動練習

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

library(dplyr)
library(ggplot2)

# Compute daily counts
daily <- bike %>%
  ___ %>%
  summarise(n = ___)

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