ComeçarComece de graça

Visualizing the data: Counts by hour-of-day

We can now create a Trelliscope display using ggplot2. We want to plot number of rides vs. hour of day, colored by workweek / weekend, and faceted by route using facet_trelliscope().

route_hod is available in your workspace, but it only contains the top 8 routes. We will view the result for all top routes in the final exercise.

Este exercício faz parte do curso

Visualizing Big Data with Trelliscope in R

Ver curso

Instruções do exercício

  • Use points to plot start_hod on the x-axis and n on the y-axis and color the points by weekday. Specify size = 3 in your geom specification to help the points stand out more prominently on the plot.
  • Facet by start and end station name, and set initial layout to be 2 rows and 4 columns.
  • To use less space, remove the legend adding theme(legend.position = "none") to your ggplot2 specification.

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

library(trelliscopejs)
library(ggplot2)

# Create the plot
ggplot(___) +
  ___ +
  facet_trelliscope(~ ___ + ___, ___) +
  theme(___)
Editar e executar o código