timetable_arrivals: Fetch an arrival board for a specific train station

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

Description

Provide a station, date and time to receive an arrival board from the DB Timetable-API. Besides usual information, train specific information is provided, too.

Usage

1
2
timetable_arrivals(station, direction, date, time, authkey, reference = FALSE,
  lang = "de", format = "json")

Arguments

station

character string. Station specific ID from timetable_station().

direction

character string. Optional. Constrain the arrival board by providing a direction through a station ID from timetable_station().

date

character string. Set the date of the arrival board. Format: YYYY-MM-DD.

time

character string. Set the time of the arrival board. Format: HH:MM.

authkey

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

reference

logical. If TRUE, additional train specific reference URLs are returned with the arrival board. Default is FALSE.

lang

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

format

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

Value

A arrival board as 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_station, timetable_departures, timetable_reference

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
berlin <- timetable_station(pattern  = "Berlin Hbf", authkey = authKey)
timetable_arrivals(station = berlin, date = "2016-12-31", time = "12:00",
                   authkey = authKey)

# receive reference URLs
timetable_arrivals(station = berlin, date = "2016-12-31", time = "12:00",
                   reference = TRUE, authkey = authKey)

# use a direction
hamburg <- timetable_station(pattern  = "Hamburg Hbf", authkey = authKey)
timetable_arrivals(station = berlin, direction = hamburg,
                   date = "2016-12-31", time = "12:00",
                   authkey = authKey)

## End(Not run)

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