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