Learn R Programming

gtfstools (version 2.0.1)

fix_overnight_stop_times: Fix the times after midnight of stop_times

Description

Also used by the functions that calculate speeds and durations, which fix the times silently before using them.

Usage

fix_overnight_stop_times(
  gtfs,
  trip_id = NULL,
  warn = TRUE,
  by_reference = FALSE,
  detect_only = FALSE
)

Value

The GTFS object, or, with detect_only = TRUE, TRUE if any time would be fixed and FALSE otherwise.

Arguments

gtfs

A GTFS object whose stop_times has the trip_id, stop_sequence, arrival_time and departure_time fields, of the classes asserted by fix_overnight_times().

trip_id

A character vector with the trip_ids to fix, or NULL (the default) for every trip. Each trip is fixed on its own, so the functions that only use some trips fix only these.

warn

Whether to warn about the times that still go back after the fix, and about malformed times.

by_reference

Whether to write the fixed times into gtfs$stop_times itself. If FALSE, the table is copied before being changed.

detect_only

Whether to only detect the times to fix, without fixing them.