Get startedGet started for free

Daily plots

Let's now look at the number of rides vs. hour for each day. To start, we'll create a summary dataset for the first full month in the dataset (May) and look at it.

This exercise is part of the course

Visualizing Big Data with Trelliscope in R

View Course

Exercise instructions

  • Filter the data to the month of May (use start_mon)
  • Count the number of rides for each combination of start_day, start_hod, and membership
  • Use points to plot the number of rides vs. hour of day and color the points based on membership
  • Use facet on start_day, using facet_wrap() and specifying 7 columns for day-of-week alignment

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

library(dplyr)
library(ggplot2)

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

# Plot the result
ggplot(daily_may, aes(___, ___, color = ___)) +
  ___ +
  ___
Edit and Run Code