bike_latest_files: Check whether files in database are the latest published...

Description Usage Arguments Value Examples

Description

Check whether files in database are the latest published files

Usage

1

Arguments

bikedb

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

Value

A named vector of binary values: TRUE is files in bikedb are the latest versions; otherwise FALSE, in which case store_bikedata could be run to update the database.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## 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)
# Remove one London file that triggers an API call which may fail tests:
file.remove (file.path (tempdir(), "01aJourneyDataExtract10Jan16-23Jan16.csv"))
bikedb <- file.path (data_dir, 'testdb')
store_bikedata (data_dir = data_dir, bikedb = bikedb)
# bike_latest_files (bikedb)
# All false because test data are not current, but would pass with real data

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)

bikedata documentation built on Jan. 9, 2020, 5:09 p.m.