Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check_field_class() raises error when any of the columns of the specified table has more than one class #31

Open
dhersz opened this issue Dec 15, 2022 · 0 comments

Comments

@dhersz
Copy link
Collaborator

dhersz commented Dec 15, 2022

This is using the dev version

library(tidytransit)

local_gtfs_path <- system.file("extdata", "google_transit_nyc_subway.zip", package = "tidytransit")
gtfs <- read_gtfs(local_gtfs_path)

gtfsio::check_field_class(gtfs, "stop_times", "arrival_time", "hms")
#> Error in vapply(x[[file]], class, character(1)): values must be length 1,
#>  but FUN(X[[2]]) result is length 2

class(gtfs$stop_times$arrival_time)
#> [1] "hms"      "difftime"

class(gtfs$stop_times$arrival_time) <- "hms"
class(gtfs$stop_times$departure_time) <- "hms"
gtfsio::check_field_class(gtfs, "stop_times", "arrival_time", "hms")
#> [1] TRUE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant