View source: R/fare_structure.R
setup_fare_structure | R Documentation |
Creates a basic fare structure that describes how transit fares should be
calculated in travel_time_matrix()
, expanded_travel_time_matrix()
,
accessibility()
and pareto_frontier()
. This fare structure can be
manually edited and adjusted to the existing rules in your study area, as
long as they stick to some basic premises. Please see fare structure
vignette for more information on how the fare structure works:
vignette("fare_structure", package = "r5r")
.
setup_fare_structure(
r5r_core,
base_fare,
by = "MODE",
debug_path = NULL,
debug_info = NULL
)
r5r_core |
An object to connect with the R5 routing engine, created with
|
base_fare |
A numeric. A base value used to populate the fare structure. |
by |
A string. Describes how |
debug_path |
Either a path to a |
debug_info |
Either a string (when |
A fare structure object.
Other fare structure:
read_fare_structure()
,
write_fare_structure()
library(r5r)
data_path <- system.file("extdata/poa", package = "r5r")
r5r_core <- setup_r5(data_path)
fare_structure <- setup_fare_structure(r5r_core, base_fare = 5)
# to debug fare calculation
fare_structure <- setup_fare_structure(
r5r_core,
base_fare = 5,
debug_path = "fare_debug.csv",
debug_info = "MODE"
)
fare_structure$debug_settings
# debugging can be manually turned off by setting output_file to ""
fare_structure$debug_settings <- ""
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.