| get_speeds | R Documentation |
Combines distance in meters and duration in seconds to calculate kilometers per hour.
get_speeds(
gtfs,
method = "by_trip",
trips = "all",
distance_method = c("shapes", "straight")
)
gtfs |
A GTFS object. |
method |
One of '"by_trip"', '"by_route"', or '"detailed"'. Legacy dotted values remain accepted. |
trips |
Character trip IDs or '"all"'. |
distance_method |
Distance calculation passed to [get_distances()]. |
Every summary uses the same segment geometry selected by 'distance_method'.
A tibble with 'average.speed' for route and trip methods, or segment-level 'speed' for the detailed method. 'direction_id' is retained when available.
[GTFSwizard::get_distances()], [GTFSwizard::get_durations()]
get_speeds(for_rail_gtfs, "by_route")
get_speeds(for_rail_gtfs, "by_trip")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.