Learn R Programming

bikedata (version 0.2.4)

bike_distmat: Extract station-to-station distance matrix

Description

Extract station-to-station distance matrix

Usage

bike_distmat(bikedb, city, expand = 0.5, long = FALSE, quiet = TRUE)

Arguments

bikedb

A string containing the path to the SQLite3 database. If no directory specified, it is presumed to be in tempdir().

city

City for which tripmat is to be aggregated

expand

Distances are calculated by routing through the OpenStreetMap street network surrounding the bike stations, with the street network expanded by this amount to ensure all stations can be connected.

long

If FALSE, a square distance matrix of (num-stations, num_stations) is returned; if TRUE, a long-format matrix of (stn-from, stn-to, distance) is returned.

quiet

If FALSE, progress is displayed on screen

Value

If long = FALSE, a square matrix of numbers of trips between each station, otherwise a long-form tibble with three columns of of (start_station_id, end_station_id, distance)