View source: R/get_servicepattern.R
get_servicepattern | R Documentation |
The 'get_servicepattern' function identifies and organizes unique service patterns within a 'wizardgtfs' object. It groups services by common dates of operation and assigns each a frequency-based pattern identifier.
get_servicepattern(gtfs)
gtfs |
A GTFS object, ideally of class 'wizardgtfs'. If not, it will be converted. |
The function first checks if the input 'gtfs' object is of class 'wizardgtfs'. If not, it converts it using 'as_wizardgtfs()'. It then groups services by common dates of operation, assigns a frequency to each unique pattern, and organizes these into service pattern identifiers, ordered by their frequency.
A data frame containing unique service patterns with the following columns:
Unique identifier(s) for each service.
An identifier for each distinct service pattern based on operational dates, in the format "servicepattern-N".
The frequency of each service pattern, indicating the number of dates associated with that pattern.
[GTFSwizard::as_wizardgtfs()]
# Generate service patterns for a GTFS object
service_patterns <- get_servicepattern(gtfs = for_rail_gtfs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.