Checks the existence of fields, represented by columns, inside a GTFS object element.
check_field_exists(x, file, fields)
assert_field_exists(x, file, fields)
check_field_exists
returns TRUE
if the check is successful, and
FALSE
otherwise. assert_field_exists
returns x
invisibly if the check is
successful, and throws an error otherwise.
Other checking functions:
check_field_class()
,
check_file_exists()
gtfs_path <- system.file("extdata/ggl_gtfs.zip", package = "gtfsio")
gtfs <- import_gtfs(gtfs_path)
check_field_exists(gtfs, "calendar", c("monday", "tuesday"))
#> [1] TRUE
check_field_exists(gtfs, "calendar", c("monday", "oi"))
#> [1] FALSE