powered by
`plot_calendar` creates a calendar heatmap visualization of the number of trips in a GTFS dataset for each day, with options for monthly and yearly faceting.
plot_calendar(gtfs, ncol = 6, facet_by_year = FALSE)
A `ggplot2` object showing a calendar heatmap of the daily trip counts across the specified GTFS date range.
A GTFS object, ideally of class `wizardgtfs`. If not, it will be converted.
Number of columns for monthly faceting. Ignored if `facet_by_year = TRUE`.
Logical value. If `TRUE`, plots data by year with each month in a separate column.
- The function calculates daily trip frequencies from the `service_id` and `dates_services` tables in the GTFS object.
- Days with no trips are marked in black, while other days are shaded on a gradient from pink (low trip count) to red (high trip count).
- If `facet_by_year = TRUE`, the plot will display each year in separate rows, and `ncol` is ignored.
[GTFSwizard::as_wizardgtfs()]
# \donttest{ # Plot a GTFS trip calendar with 4 columns plot_calendar(for_rail_gtfs, ncol = 4) # Plot a GTFS trip calendar, faceting by year plot_calendar(for_rail_gtfs, facet_by_year = TRUE) # }
Run the code above in your browser using DataLab