Learn R Programming

gtfs2gps (version 1.4-0)

filter_by_day: Filter GTFS trips operating on given days

Description

Filter a GTFS data read using gtfs2gps::read_gtfs(). It removes the trips operating in non-selected days. Note that it might produce inconsistent outputs that can be removed by using gtfs2gps::remove_invalid().

Usage

filter_by_day(gtfs_data, days)

Arguments

gtfs_data

A list of data.tables read using gtfs2gps::reag_gtfs().

days

A vector of selected week days written in the same way of column names in calendar file of GTFS (sunday, monday, etc.).

Value

A filtered GTFS data with the trips only from the selected days.

Examples

Run this code
# NOT RUN {
poa <- read_gtfs(system.file("extdata/poa.zip", package = "gtfs2gps"))

subset <- filter_by_day(poa, c("wednesday", "friday"))
# }

Run the code above in your browser using DataLab