store_bikedata: Store hire bicycle data in SQLite3 database

Description Usage Arguments Value Details Note

Description

Store hire bicycle data in SQLite3 database

Usage

1
store_bikedata(city, data_dir, bikedb, create_index = TRUE, quiet = FALSE)

Arguments

city

One or more cities for which to download and store bike data, or names of corresponding bike systems (see Details below).

data_dir

A character vector giving the directory containing the data files downloaded with dl_bikedata for one or more cities. Only if this parameter is missing will data be downloaded.

bikedb

A string containing the path to the SQLite3 database to use. If it doesn't already exist, it will be created, otherwise data will be appended to existing database. If no directory specified, it is presumed to be in tempdir().

create_index

If TRUE, creates an index on the start and end station IDs and start and stop times.

quiet

If FALSE, progress is displayed on screen

Value

Number of trips added to database

Details

City names are not case sensitive, and must only be long enough to unambiguously designate the desired city. Names of corresponding bike systems can also be given. Currently possible cities (with minimal designations in parentheses) and names of bike hire systems are:

New York City (ny) Citibike
Washington, D.C. (dc) Capital Bike Share
Chicago (ch) Divvy Bikes
Los Angeles (la) Metro Bike Share
Boston (bo) Hubway

Note

Data for different cities are all stored in the same database, with city identifiers automatically established from the names of downloaded data files. This function can take quite a long time to execute (typically > 10 minutes), and generates a SQLite3 database file several gigabytes in size. Downloaded data files are removed after loading into the database; files may be downloaded and stored permanently with dl_bikedata, and the corresponding data_dir passed to this function.


mpadge/sqlite3-test documentation built on May 23, 2019, 6:24 a.m.