Note that some GTFS feeds contain a frequency data frame already. Consider using this instead, as it will be more accurate than what tidytransit calculates.

get_route_frequency(gtfs_obj, start_hour = 6, end_hour = 22,
  quiet = FALSE, service_ids = c(), dow = c(1, 1, 1, 1, 1, 0, 0))

Arguments

gtfs_obj

a list of gtfs dataframes as read by the trread package.

start_hour

(optional) an integer, default 6 (6 am)

end_hour

(optional) an integer, default 22 (10 pm)

quiet

default FALSE. whether to echo process messages

service_ids

(optional) a string from the calendar dataframe identifying a particular service schedule.

dow

(optional) an integer vector with days of week. monday=1. default: c(1,1,1,1,1,0,0)

Value

a gtfs_obj with a dataframe of routes with variables (gtfs_obj$.$routes_frequency) for headway/frequency for a route within a given time frame

Details

should take:

Examples

data(gtfs_obj) gtfs_obj <- get_route_frequency(gtfs_obj)
#> Calculating route and stop headways.
#> [1] "NOTE: A pre-calculated frequencies dataframe exists for this feed already--consider using that."
x <- order(gtfs_obj$.$routes_frequency$median_headways) head(gtfs_obj$.$routes_frequency[x,])
#> # A tibble: 6 x 5 #> route_id median_headways mean_headways st_dev_headways stop_count #> <chr> <int> <int> <dbl> <int> #> 1 1693 7 7 0.9 30 #> 2 1683 15 23 34.4 18 #> 3 1689 21 21 2.65 42 #> 4 4926 21 21 2.11 50 #> 5 1690 23 22 2.94 28 #> 6 1679 24 46 82.3 13