filter_by_trip_id {gtfstools} | R Documentation |
Filter GTFS object by trip_id
Description
Filters a GTFS object by trip_id
s, keeping (or dropping) the relevant
entries in each file.
Usage
filter_by_trip_id(gtfs, trip_id, keep = TRUE)
Arguments
gtfs |
A GTFS object, as created by |
trip_id |
A character vector. The |
keep |
A logical. Whether the entries related to the specified
|
Value
The GTFS object passed to the gtfs
parameter, after the filtering
process.
See Also
Other filtering functions:
filter_by_agency_id()
,
filter_by_route_id()
,
filter_by_route_type()
,
filter_by_service_id()
,
filter_by_sf()
,
filter_by_shape_id()
,
filter_by_stop_id()
,
filter_by_time_of_day()
,
filter_by_weekday()
Examples
data_path <- system.file("extdata/spo_gtfs.zip", package = "gtfstools")
gtfs <- read_gtfs(data_path)
trip_ids <- c("CPTM L07-0", "2002-10-0")
object.size(gtfs)
# keeps entries related to passed trip_ids
smaller_gtfs <- filter_by_trip_id(gtfs, trip_ids)
object.size(smaller_gtfs)
# drops entries related to passed trip_ids
smaller_gtfs <- filter_by_trip_id(gtfs, trip_ids, keep = FALSE)
object.size(smaller_gtfs)
[Package gtfstools version 1.2.0 Index]