This repository has been archived by the owner on Aug 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
77 lines (58 loc) · 1.58 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
---
output: github_document
---
```{r, echo = FALSE}
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%'
)
```
[![Travis-CI Build Status]([![Travis-CI Build Status](https://travis-ci.com/r-gtfs/bustt.svg?branch=master)](https://travis-ci.com/r-gtfs/bustt))
Description
----------
`bustt` is a package for working with time in transit schedule data. In particular, it is focused on questions like:
- What are the headway of train lines at 59-Street Columbus Circle on Saturdays?
- What are the typical headway characteristics of the A Train on weekdays?
Installation
-----------------
You can install this package from GitHub using the devtools package:
```
if (!require(devtools)) {
install.packages('devtools')
}
devtools::install_github('r-gtfs/gtschedule')
```
Example Usage
------------------
```{r readme-body}
library(dplyr)
library(trread)
library(bustt)
```
```{r}
NYC <- import_gtfs("http://web.mta.info/developers/data/nyct/subway/google_transit.zip")
```
### Route Headways
List the routes with the shortest median headways.
```{r}
route_frequency_summary <- route_frequency(NYC) %>%
arrange(median_headways)
head(route_frequency_summary)
```
### Stop Headways
List the stops with the shortest headways in the system.
```{r}
stop_frequency_summary <- stop_frequency(NYC, by_route=FALSE) %>%
inner_join(NYC$stops_df) %>%
select(stop_name, headway) %>%
arrange(headway)
head(stop_frequency_summary)
```