View source: R/filter_by_route_id.R
filter_by_route_id | R Documentation |
route_id
Filters a GTFS object by route_id
s, keeping (or dropping) the relevant
entries in each file.
filter_by_route_id(gtfs, route_id, keep = TRUE)
gtfs |
A GTFS object, as created by |
route_id |
A character vector. The |
keep |
A logical. Whether the entries related to the specified
|
The GTFS object passed to the gtfs
parameter, after the filtering
process.
Other filtering functions:
filter_by_agency_id()
,
filter_by_route_type()
,
filter_by_service_id()
,
filter_by_sf()
,
filter_by_shape_id()
,
filter_by_spatial_extent()
,
filter_by_stop_id()
,
filter_by_time_of_day()
,
filter_by_trip_id()
,
filter_by_weekday()
data_path <- system.file("extdata/spo_gtfs.zip", package = "gtfstools")
gtfs <- read_gtfs(data_path)
route_ids <- c("6450-51", "CPTM L11")
object.size(gtfs)
# keeps entries related to passed route_ids
smaller_gtfs <- filter_by_route_id(gtfs, route_ids)
object.size(smaller_gtfs)
# drops entries related to passed route_ids
smaller_gtfs <- filter_by_route_id(gtfs, route_ids, keep = FALSE)
object.size(smaller_gtfs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.