a <- gtfs2gps::gtfs2gps(gtfs_small)
#> Converting shapes to sf objects
#> Using 3 CPU cores
#> Processing the data
#> 9 'speed' values are NA for shape_id 'T2-1'.
#> Some 'speed' values are NA in the returned data.
Check class() after
str(gtfs_small$stop_times[,c("arrival_time","departure_time")])
#> Classes 'data.table' and 'data.frame': 62 obs. of 2 variables:
#> $ arrival_time : int 19200 NA NA NA NA NA NA NA NA NA ...
#> $ departure_time: int 19200 NA NA NA NA NA NA NA NA NA ...
#> - attr(*, ".internal.selfref")=<externalptr>
Notice that the function does note work anymore
when the gtfs_small is applied again
a <- gtfs2gps::gtfs2gps(gtfs_small)
#> Error in string_to_seconds(departure_time): Assertion on 'string' failed: Must be of type 'character', not 'integer'.
gtfs2gps::gtfs2gps()
is changing thearrival_time
anddeparture_time
by reference, which then changes the input fileSee reprex below
Check
class()
beforeApply function
Check
class()
afterNotice that the function does note work anymore when the
gtfs_small
is applied againCreated on 2022-07-01 by the reprex package (v2.0.1)