plot_frequency {GTFSwizard} | R Documentation |
Plot System Frequency by Hour
Description
'plot_frequency' generates an interactive plot of the frequency of trips by hour across the GTFS dataset. The plot shows hourly trip distributions, hourly average frequency, and an overall average frequency for the system, providing insights into peak times and overall transit service frequency.
Usage
plot_frequency(gtfs)
Arguments
gtfs |
A GTFS object. This should ideally be of the 'wizardgtfs' class, or it will be converted. |
Details
The function first calculates hourly and overall average frequencies using a weighted mean based on ‘pattern_frequency'. Frequencies are plotted by hour of the day to visualize the system’s trip distribution patterns.
Value
A 'plotly' interactive plot displaying hourly frequency distributions, including:
- Hourly Distribution: Boxplots showing frequency distribution across hours.
- Hourly Average Frequency: A line indicating the weighted average frequency for each hour.
- Overall Average Frequency: A dashed line marking the system's overall average frequency.
See Also
[GTFSwizard::get_frequency()]
Examples
if (interactive()) {
# Plot the frequency of trips by hour for a GTFS object
plot_frequency(for_rail_gtfs)
}