View source: R/metro.stations.R
metro.stations | R Documentation |
The metro.stations()
function opens a connection
to the TMB API to retrieve data related
to the metro stations and lines in Barcelona.
# Without the line argument, the function retrieves # data from all metro stations metro.stations(app_id, app_key) # Metro stations corresponding to the specified line metro.stations(app_id, app_key, line = c(1, 2, 3, 4, 5, 11, 91, 94, 99, 101, 104))
app_id |
character |
app_key |
character |
line |
numeric |
To execute the function you need the credentials app_id
and
app_key
.
Register on the TMB API portal
and create an application to obtain your credentials
If you want to retrieve all the metro stations and their resources, execute the function without arguments.
You can filter by metro line and obtain a subset.
Xavier Vivancos
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.