เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

Number of daily rides

Make a summary plot of the number of daily rides with workweek / weekend days colored differently.

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

Visualizing Big Data with Trelliscope in R

ดูคอร์ส

คำแนะนำการฝึกหัด

  • Create a dataset of daily counts using group_by() and summarise(). Group by start_day and be sure to include the variable weekday as well.
  • Plot the result, using points to plot the number of rides on the y-axis and the start day on the x-axis. Color the points by weekday.

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

library(dplyr)
library(ggplot2)

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

# Plot the result
ggplot(daily, aes(___, ___, color = ___)) +
  ___
แก้ไขและรันโค้ด