Effect of membership and weekday
Expanding on the previous plot, let's add one more variable into our summary, adding a facet dimension for whether or not the rider is a member of BIXI.
Questo esercizio fa parte del corso
Visualizing Big Data with Trelliscope in R
Istruzioni dell'esercizio
- Compute the number of rides,
nfor each combination of start week, start hour of day, weekday, and membership. - Use points to plot
non the y-axis andstart_wkon the x-axis and color the points byweekday. - Facet using
facet_grid()to varystart_hodacross columns andmembershipacross rows.
Esercizio pratico interattivo
Prova a risolvere questo esercizio completando il codice di esempio.
library(dplyr)
library(ggplot2)
# Compute wk_memb_hod
wk_memb_hod <- bike %>%
___ %>%
___
# Plot the result
ggplot(wk_memb_hod, aes(___, ___, color = ___)) +
___ +
facet_grid(___ ~ ___) +
scale_y_sqrt()