plot_headways {GTFSwizard} | R Documentation |
Plot System Average Headway by Hour
Description
'plot_headways' generates an interactive plot of the average headways (time between trips) by hour across the GTFS dataset. The plot displays hourly headway distributions for each service pattern and includes an overall average headway line.
Usage
plot_headways(gtfs)
Arguments
gtfs |
A GTFS object. This should ideally be of the 'wizardgtfs' class, or it will be converted. |
Details
The function calculates hourly and overall average headways by weighting 'pattern_frequency' and 'trips' for each service pattern. The plot provides a visual representation of how average headways vary by hour and across service patterns.
Value
A 'plotly' interactive plot showing the hourly average headway (in minutes) across service patterns, including:
- Service Pattern Distribution: Lines for each service pattern, showing hourly headway values.
- Overall Average Headway: A dashed line marking the weighted overall average headway.
See Also
[GTFSwizard::get_headways()]
Examples
if (interactive()) {
# Plot average headway by hour for a GTFS object
plot_headways(for_rail_gtfs)
}