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.
Diese Übung ist Teil des Kurses
Visualizing Big Data with Trelliscope in R
Anleitung zur Übung
- Filter the data to the month of May (use
start_mon
) - Count the number of rides for each combination of
start_day
,start_hod
, andmembership
- Use points to plot the number of rides vs. hour of day and color the points based on membership
- Use facet on
start_day
, usingfacet_wrap()
and specifying 7 columns for day-of-week alignment
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
library(dplyr)
library(ggplot2)
# Compute daily_may
daily_may <- bike %>%
filter(___) %>%
group_by(___) %>%
summarise(n = ___)
# Plot the result
ggplot(daily_may, aes(___, ___, color = ___)) +
___ +
___