`merge_gtfs` combines two GTFS datasets into a single `wizardgtfs` object, with an option to append suffixes to ensure unique identifiers across tables.
Usage
merge_gtfs(gtfs.x, gtfs.y, suffix = TRUE)
Value
A merged `wizardgtfs` object containing all records from `gtfs.x` and `gtfs.y` across GTFS tables.
Arguments
gtfs.x
The first GTFS dataset, ideally of class `wizardgtfs`. If not, it will be converted.
gtfs.y
The second GTFS dataset, ideally of class `wizardgtfs`. If not, it will be converted.
suffix
A logical value. If `TRUE`, appends `.x` and `.y` suffixes to identifier columns in `gtfs.x` and `gtfs.y`, respectively, to prevent conflicts.
Details
- When `suffix = TRUE`, unique suffixes are appended to key identifiers in `gtfs.x` and `gtfs.y` (e.g., `agency_id`, `route_id`, `trip_id`).
- After suffix handling, the function merges individual tables, ensuring no duplicated entries.
- Finally, the resulting list is converted into a `wizardgtfs` object.