bike_stations | R Documentation |
Extract station matrix from SQLite3 database
bike_stations(bikedb, city)
bikedb |
A string containing the path to the SQLite3 database.
If no directory specified, it is presumed to be in |
city |
Optional city (or vector of cities) for which stations are to be extracted |
Matrix containing data for each station
## Not run:
data_dir <- tempdir ()
bike_write_test_data (data_dir = data_dir)
# or download some real data!
# dl_bikedata (city = 'la', data_dir = data_dir)
bikedb <- file.path (data_dir, 'testdb')
store_bikedata (data_dir = data_dir, bikedb = bikedb)
# create database indexes for quicker access:
index_bikedata_db (bikedb = bikedb)
stations <- bike_stations (bikedb)
head (stations)
bike_rm_test_data (data_dir = data_dir)
bike_rm_db (bikedb)
# don't forget to remove real data!
# file.remove (list.files (data_dir, pattern = '.zip'))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.