merge_gtfs: Merge GTFS files

Description Usage Arguments Value Details See Also Examples

View source: R/merge_gtfs.R

Description

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

Usage

1

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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))

gtfstools documentation built on Feb. 23, 2021, 9:06 a.m.