timetable_station: Find a station and its internal ID

Description Usage Arguments Value Note Author(s) References See Also Examples

Description

Use a search pattern to find a specific train station in Germany and its internal ID. The internal ID can be used to query the DB Timetable-API.

Usage

1
2
timetable_station(pattern, authkey, first = TRUE, lang = "de",
  format = "json")

Arguments

pattern

character string. Pattern used to find a specific train station, e.g. 'Berlin'.

authkey

character string. Authentication key to access the Timetable-API. See Note.

first

logical. If TRUE, the ID of the first matching station is returned. If FALSE, a list of stations is returned.

lang

character string. Set the API language. Default is 'de'.

format

character string. Set the API format. Default is 'json'.

Value

A character string if first = TRUE. Otherwise a data.frame.

Note

To use this function and to access the DB Timetable-API, you need to have an authentication key. Authentication keys can be requested from DBOpenData@deutschebahn.com.

Author(s)

Philipp Ottolinger

References

http://data.deutschebahn.com/dataset/api-fahrplan

See Also

timetable_departures, timetable_arrivals, timetable_reference

Examples

1
2
3
4
5
## Not run: 
timetable_station(pattern = "Berlin", authkey = authKey)
timetable_station(pattern = "Hamburg", authkey = authKey, first = FALSE)

## End(Not run)

ottlngr/DBopen documentation built on May 24, 2019, 5:13 p.m.