Learn R Programming

tidytransit (version 0.7.1)

filter_stop_times: Filter a stop_times table for a given date and timespan.

Description

Filter a stop_times table for a given date and timespan.

Usage

filter_stop_times(gtfs_obj, extract_date, min_departure_time, max_arrival_time)

Arguments

gtfs_obj

a gtfs feed

extract_date

date to extract trips from in YYYY-MM-DD format

min_departure_time

The earliest departure time. Can be given as "HH:MM:SS", hms object or numeric value in seconds.

max_arrival_time

The latest arrival time. Can be given as "HH:MM:SS", hms object or numeric value in seconds

This function creates filtered stop_times for travel_times() and raptor(). If you want to filter a feed multiple times it is faster to precalculate date_service_table with set_date_service_table().

Examples

Run this code
# NOT RUN {
feed_path <- system.file("extdata", "sample-feed-fixed.zip", package = "tidytransit")
g <- read_gtfs(feed_path)

# filter the sample feed
stop_times <- filter_stop_times(g, "2007-01-06", "06:00:00", "08:00:00")
# }

Run the code above in your browser using DataLab