Skip to contents

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.

data_path

The data path used to build the network

Value

List origins and destinations unchanged or in swapped order