get_speeds: Calculate Scheduled Speeds

View source: R/get_speeds.R

get_speedsR Documentation

Calculate Scheduled Speeds

Description

Combines distance in meters and duration in seconds to calculate kilometers per hour.

Usage

get_speeds(gtfs, method = "by_trip", trips = "all")

Arguments

gtfs

A GTFS object.

method

One of '"by_trip"', '"by_route"', or '"detailed"'. Legacy dotted values remain accepted.

trips

Character trip IDs or '"all"'.

Details

Detailed distances are straight-line geodesic distances between stops. Route and trip distances follow 'shapes.txt', or inferred straight-line shapes if the feed has none.

Value

A tibble with 'average.speed' for route and trip methods, or segment-level 'speed' for the detailed method. 'direction_id' is retained when available.

See Also

[GTFSwizard::get_distances()], [GTFSwizard::get_durations()]

Examples

get_speeds(for_rail_gtfs, "by_route")
get_speeds(for_rail_gtfs, "by_trip")


GTFSwizard documentation built on Aug. 21, 2026, 5:16 p.m.