gtfstools (version 0.1.0)

merge_gtfs: Merge GTFS files

Description

Combines many GTFS file into a single one and validates the resulting object.

Usage

merge_gtfs(..., files = NULL, quiet = TRUE, warnings = TRUE)

Arguments

...

GTFS objects, as created by read_gtfs, to be merged. Each argument can either be a GTFS or a list of GTFS objects.

files

A character vector listing the GTFS text files (i.e. the ones represented by data.tables) to be merged. If NULL (the default) all files are merged.

quiet

Whether to hide log messages (defaults to TRUE).

warnings

Whether to display warning messages (defaults to TRUE).

Value

Returns a GTFS object, with an updated validation_result attribute, in which each data.table is the combination (by row) of data.tables with the same name from the GTFS objects passed in ....

Details

Please note that this function does not disambiguate ids that may be repeated within different GTFS objects. Please let us know if you'd like to see this feature implemented.

See Also

validate_gtfs

Examples

Run this code
# NOT RUN {
spo_path <- system.file("extdata/spo_gtfs.zip", package = "gtfstools")
ggl_path <- system.file("extdata/ggl_gtfs.zip", package = "gtfstools")

spo_gtfs <- read_gtfs(spo_path)
names(spo_gtfs)

ggl_gtfs <- read_gtfs(ggl_path)
names(ggl_gtfs)

merged_gtfs <- merge_gtfs(spo_gtfs, ggl_gtfs)
names(merged_gtfs)

# use a list() to programatically merge many GTFS objects
merged_gtfs <- merge_gtfs(list(spo_gtfs, ggl_gtfs))

# }

Run the code above in your browser using DataLab