View source: R/get_parent_station.R
get_parent_station | R Documentation |
Returns the (recursive) parent stations of each specified stop_id
.
Recursive in this context means it returns all parents' parents (i.e. first
parents, then parents' parents, and then their parents, and so on).
get_parent_station(gtfs, stop_id = NULL)
gtfs |
A GTFS object, as created by |
stop_id |
A string vector including the |
A data.table
containing the stop_id
s and their parent_station
s.
If a stop doesn't have a parent, its correspondent parent_station
entry
is marked as ""
.
get_children_stops()
data_path <- system.file("extdata/ggl_gtfs.zip", package = "gtfstools")
gtfs <- read_gtfs(data_path)
parents <- get_parent_station(gtfs)
head(parents)
# use the stop_id argument to control which stops are analyzed
parents <- get_parent_station(gtfs, c("B1", "B2"))
parents
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.