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

bus_stops(Lat = NULL, Lon = NULL, Radius = NULL, api_key = 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.

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().

Value

Data frame containing stop information

Examples

if (FALSE) {
bus_stops(38.8895, -77.0353, 500)
}