Checks the existence of elements inside a GTFS object that represent specific GTFS text files.

check_files_exist(x, files)

assert_files_exist(x, files)

Arguments

x

A GTFS object.

files

A character vector. The files to check the existence of.

Value

check_files_exist returns TRUE if the check is successful, and FALSE otherwise.
assert_files_exist returns x invisibly if the check is successful, and throws an error otherwise.

See also

Other checking functions: check_fields_exist(), check_fields_types()

Examples

gtfs_path <- system.file("extdata/ggl_gtfs.zip", package = "gtfsio")
gtfs <- import_gtfs(gtfs_path)

check_files_exist(gtfs, c("calendar", "agency"))
#> [1] TRUE

check_files_exist(gtfs, c("calendar", "oi"))
#> [1] FALSE