# \dontshow{
old_dt_threads <- data.table::setDTthreads(1)
on.exit(data.table::setDTthreads(old_dt_threads), add = TRUE)
# }
data_path <- system.file("extdata/spo_gtfs.zip", package = "gtfstools")
gtfs <- read_gtfs(data_path)
dwell_times <- get_dwell_time(gtfs)
head(dwell_times)
# use the trip_id and stop_id arguments to control which trips and stops
# are analyzed
get_dwell_time(gtfs, trip_id = "CPTM L07-0")
get_dwell_time(gtfs, stop_id = "18960")
get_dwell_time(
gtfs,
trip_id = c("CPTM L08-0", "CPTM L09-0"),
stop_id = "18960"
)
# blank times result in NA dwell times. use the unit argument to control in
# which unit the dwell times are calculated
ggl_path <- system.file("extdata/ggl_gtfs.zip", package = "gtfstools")
ggl_gtfs <- read_gtfs(ggl_path)
get_dwell_time(ggl_gtfs, trip_id = "AWE1", unit = "min")
Run the code above in your browser using DataLab