-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow users to keep their data, save time and traffic - #141 #144
Conversation
Addressing the CI. |
This looks awesome @layik ! Many thanks. |
Unsure why that crashed, just restarted the build: https://travis-ci.org/ropensci/stats19/builds/636896027?utm_source=github_status&utm_medium=notification |
Sorry to request the review before Travis green tick. I just thought it would be straightforward, it never is :) |
Codecov Report
@@ Coverage Diff @@
## master #144 +/- ##
==========================================
+ Coverage 67.74% 68.36% +0.62%
==========================================
Files 7 7
Lines 372 392 +20
==========================================
+ Hits 252 268 +16
- Misses 120 124 +4
Continue to review full report at Codecov.
|
Just leaves us with some docs/vignette work. Over to you @Robinlovelace. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, based on checks here I see before the PR:
# before PR
# 1st time
library(stats19)
#> Data provided under OGL v3.0. Cite the source and link to:
#> www.nationalarchives.gov.uk/doc/open-government-licence/version/3/
a = get_stats19(2018)
#> Files identified: dftRoadSafetyData_Accidents_2018.csv
#> http://data.dft.gov.uk.s3.amazonaws.com/road-accidents-safety-data/dftRoadSafetyData_Accidents_2018.csv
#> Attempt downloading from:
#> Data saved at /tmp/Rtmp166Sja/dftRoadSafetyData_Accidents_2018.csv
#> Reading in:
#> /tmp/Rtmp166Sja/dftRoadSafetyData_Accidents_2018.csv
Created on 2020-01-14 by the reprex package (v0.3.0)
# 2nd time
library(stats19)
#> Data provided under OGL v3.0. Cite the source and link to:
#> www.nationalarchives.gov.uk/doc/open-government-licence/version/3/
a = get_stats19(2018)
#> Files identified: dftRoadSafetyData_Accidents_2018.csv
#> http://data.dft.gov.uk.s3.amazonaws.com/road-accidents-safety-data/dftRoadSafetyData_Accidents_2018.csv
#> Attempt downloading from:
#> Data saved at /tmp/Rtmp8dfj4s/dftRoadSafetyData_Accidents_2018.csv
#> Reading in:
#> /tmp/Rtmp166Sja/dftRoadSafetyData_Accidents_2018.csv
Created on 2020-01-14 by the reprex package (v0.3.0)
# after PR and setting STATS19_DOWNLOAD_DIRECTORY=~/stats19-data/
devtools::install_github("ropensci/stats19", "dir")
#> Skipping install of 'stats19' from a github remote, the SHA1 (0f930a88) has not changed since last install.
#> Use `force = TRUE` to force installation
# 1st time
library(stats19)
#> Data provided under OGL v3.0. Cite the source and link to:
#> www.nationalarchives.gov.uk/doc/open-government-licence/version/3/
a = get_stats19(2018)
#> Files identified: dftRoadSafetyData_Accidents_2018.csv
#> http://data.dft.gov.uk.s3.amazonaws.com/road-accidents-safety-data/dftRoadSafetyData_Accidents_2018.csv
#> Attempt downloading from:
#> Data saved at ~/stats19-data//dftRoadSafetyData_Accidents_2018.csv
#> Reading in:
#> ~/stats19-data//dftRoadSafetyData_Accidents_2018.csv Created on 2020-01-14 by the reprex package (v0.3.0) |
Second time, it doesn't re-download the file saving time, energy and bandwidth 🎉 # 2nd time
library(stats19)
#> Data provided under OGL v3.0. Cite the source and link to:
#> www.nationalarchives.gov.uk/doc/open-government-licence/version/3/
a = get_stats19(2018)
#> Files identified: dftRoadSafetyData_Accidents_2018.csv
#> http://data.dft.gov.uk.s3.amazonaws.com/road-accidents-safety-data/dftRoadSafetyData_Accidents_2018.csv
#> Data already exists in data_dir, not downloading
#> Data saved at ~/stats19-data//dftRoadSafetyData_Accidents_2018.csv
#> Reading in:
#> ~/stats19-data//dftRoadSafetyData_Accidents_2018.csv Created on 2020-01-14 by the reprex package (v0.3.0) |
Should be good to address 141, param is exposed and can still be users choice/session var.