Checks the classes of fields, represented by columns, inside a GTFS object element.
Value
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.
See also
Other checking functions:
check_field_exists(),
check_file_exists()
Examples
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
