reverse_if_direct_mode: Reverse Origins and Destinations for Direct Modes

View source: R/set.R

reverse_if_direct_modeR Documentation

Reverse Origins and Destinations for Direct Modes

Description

Swaps the origins and destinations data frames if certain conditions are met, specifically to optimize routing performance with R5's one-to-many algorithm. The function reverses the direction of analysis when the transit mode is empty and the direct modes are WALK or BICYCLE and when the number of origin points is greater than the number of destination points.

Usage

reverse_if_direct_mode(origins, destinations, mode_list, data_path)

Arguments

origins

A data frame representing origin locations.

destinations

A data frame representing destination locations.

mode_list

A named list containing the routing modes:

Value

List origins and destinations unchanges or in swapper order

See Also

Other setting functions: set_breakdown(), set_cutoffs(), set_elevation(), set_expanded_travel_times(), set_fare_cutoffs(), set_fare_structure(), set_max_fare(), set_max_lts(), set_max_rides(), set_monte_carlo_draws(), set_n_threads(), set_new_congestion(), set_new_lts(), set_output_dir(), set_percentiles(), set_progress(), set_speed(), set_suboptimal_minutes(), set_time_window(), set_verbose()


r5r documentation built on Aug. 21, 2025, 5:44 p.m.