Description Usage Arguments Value Note
Extract station-to-station trip matrix or data.frame from SQLite3 database
1 2 3 | bike_tripmat(bikedb, city, start_date, end_date, start_time, end_time, weekday,
member, birth_year, gender, standardise = FALSE, long = FALSE,
quiet = FALSE)
|
bikedb |
A string containing the path to the SQLite3 database.
If no directory specified, it is presumed to be in |
city |
City for which tripmat is to be aggregated |
start_date |
If given (as year, month, day) , extract only those records from and including this date |
end_date |
If given (as year, month, day), extract only those records to and including this date |
start_time |
If given, extract only those records starting from and including this time of each day |
end_time |
If given, extract only those records ending at and including this time of each day |
weekday |
If given, extract only those records including the nominated weekdays. This can be a vector of numeric, starting with Sunday=1, or unambiguous characters, so "sa" and "tu" for Saturday and Tuesday. |
member |
If given, extract only trips by registered members
( |
birth_year |
If given, extract only records for trips by registered using giving birth_years within stated values (either single value or continuous range). |
gender |
If given, extract only records for trips by registered
using giving the specified genders ( |
standardise |
If TRUE, numbers of trips are standardised to the operating durations of each stations, so trip numbers are increased for stations that have only operated a short time, and vice versa. |
long |
If FALSE, a square tripmat of (num-stations, num_stations) is returns; if TRUE, a long-format matrix of (stn-from, stn-to, ntrips) is returned. |
quiet |
If FALSE, progress is displayed on screen |
If long=FALSE
, a square matrix of numbers of trips between
each station, otherwise a long-form data.frame with three columns of of
(start_station, end_station, num_trips)
The city
parameter should be given for databases containing data
from multiple cities, otherwise most of the resultant trip matrix is likely
to be empty. Both dates and times may be given either in numeric or
character format, with arbitrary (or no) delimiters between fields. Single
numeric times are interpreted as hours, with 24 interpreted as day's end at
23:59:59.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.