metro.stations: Get data from the metro service in Barcelona

View source: R/metro.stations.R

metro.stationsR Documentation

Get data from the metro service in Barcelona

Description

The metro.stations() function opens a connection to the TMB API to retrieve data related to the metro stations and lines in Barcelona.

Usage

# 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))

Arguments

app_id

character

app_key

character

line

numeric

Details

  • 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.

Author(s)

Xavier Vivancos


xavivg91/TMB documentation built on Feb. 8, 2023, 5:39 p.m.