knitr::opts_chunk$set( collapse = TRUE, cache = FALSE, comment = "#>", message = FALSE, error = FALSE, warning = FALSE, fig.path = "README/README-", fig.width=7.3, fig.height=5, out.width = '100%' )
[
bustt
is a package for working with time in transit schedule data. In particular, it is focused on questions like:
You can install this package from GitHub using the devtools package:
if (!require(devtools)) { install.packages('devtools') } devtools::install_github('r-gtfs/gtschedule')
library(dplyr) library(trread) library(bustt)
NYC <- import_gtfs("http://web.mta.info/developers/data/nyct/subway/google_transit.zip")
List the routes with the shortest median headways.
route_frequency_summary <- route_frequency(NYC) %>% arrange(median_headways) head(route_frequency_summary)
List the stops with the shortest headways in the system.
stop_frequency_summary <- stop_frequency(NYC, by_route=FALSE) %>% inner_join(NYC$stops_df) %>% select(stop_name, headway) %>% arrange(headway) head(stop_frequency_summary)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.