1. Learn
  2. /
  3. Courses
  4. /
  5. Visualizing Big Data with Trelliscope in R

Connected

Exercise

Augmenting the data: Route summary statistics

We have constructed a dataset that is nearly ready for visualization, route_hod. Let's add in a few more variables that will be useful as cognostics as we anticipate interactively viewing the display.

Instructions

100 XP
  • For each route, calculate the total number of rides.
  • For each route, calculate the difference between the mean hourly rides during the work week and the mean hourly rides during the weekend. Note that the variable n already is aggregated to counts per hour, so, for example, the workweek mean is calculated with mean(n[weekday == "workweek"]).
  • For each route, add a variable containing a URL pointing to the route on Google Maps, using the provided make_gmap_url function, providing appropriate arguments from the data.