check_field_exists {gtfsio} | R Documentation |
Check the existence of fields in a GTFS object element
Description
Checks the existence of fields, represented by columns, inside a GTFS object element.
Usage
check_field_exists(x, file, fields)
assert_field_exists(x, file, fields)
Arguments
x |
A GTFS object. |
file |
A string. The element, that represents a GTFS text file, where fields should be searched. |
fields |
A character vector. The fields to check the existence of. |
Value
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.
See Also
Other checking functions:
check_field_class()
,
check_file_exists()
Examples
gtfs_path <- system.file("extdata/ggl_gtfs.zip", package = "gtfsio")
gtfs <- import_gtfs(gtfs_path)
check_field_exists(gtfs, "calendar", c("monday", "tuesday"))
check_field_exists(gtfs, "calendar", c("monday", "oi"))
[Package gtfsio version 1.1.1 Index]