bus_stops: Bus Stop Search

View source: R/bus-stops.R

bus_stopsR Documentation

Bus Stop Search

Description

Returns a list of nearby bus stops based on latitude, longitude, and radius. Omit all parameters to retrieve a list of all stops.

Usage

bus_stops(Lat = NULL, Lon = NULL, Radius = NULL, api_key = wmata_key())

Arguments

Lat

Center point Latitude, required if Longitude and Radius are specified.

Lon

Center point Longitude, required if Latitude and Radius are specified.

Radius

Radius (meters) to include in the search area, required if Latitude and Longitude are specified.

api_key

Subscription key which provides access to this API. Defaults Sys.getenv("WMATA_KEY") via wmata_key().

Format

A tibble with 1 row per stop and 6 variables:

StopID

String array of route variants which provide service at this stop. Note that these are not date-specific; any route variant which stops at this stop on any day will be listed.

Name

Stop name. May be slightly different from what is spoken or displayed in the bus.

Lat

Latitude.

Lon

Longitude.

Distance

Distance (meters) of the stop from the provided search coordinates. Calculated using geodist::geodist() and the "cheap ruler" method.

Routes

Character string of route variants which provide service at this stop. Note that these are not date-specific; any route variant which stops at this stop on any day will be listed.

Value

Data frame containing stop information

See Also

https://developer.wmata.com/docs/services/54763629281d83086473f231/operations/5476362a281d830c946a3d6d

Other Bus Route and Stop Methods: bus_departs(), bus_path(), bus_position(), bus_routes(), bus_schedule()

Examples

## Not run: 
bus_stops(38.8895, -77.0353, 500)

## End(Not run)

metro documentation built on Nov. 2, 2023, 6:06 p.m.