Skip to content
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

Merged
merged 6 commits into from
Jan 14, 2020

Conversation

layik
Copy link
Member

@layik layik commented Jan 14, 2020

Should be good to address 141, param is exposed and can still be users choice/session var.

@layik
Copy link
Member Author

layik commented Jan 14, 2020

Addressing the CI.

@Robinlovelace
Copy link
Member

This looks awesome @layik ! Many thanks.

@Robinlovelace
Copy link
Member

@layik
Copy link
Member Author

layik commented Jan 14, 2020

Sorry to request the review before Travis green tick. I just thought it would be straightforward, it never is :)

@codecov-io
Copy link

Codecov Report

Merging #144 into master will increase coverage by 0.62%.
The diff coverage is 80%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
R/dl.R 80.48% <ø> (ø) ⬆️
R/get.R 96.42% <ø> (ø) ⬆️
R/read.R 98.46% <ø> (ø) ⬆️
R/utils.R 78.94% <80%> (+0.28%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4331d60...0f930a8. Read the comment docs.

@layik
Copy link
Member Author

layik commented Jan 14, 2020

Just leaves us with some docs/vignette work. Over to you @Robinlovelace.

Copy link
Member

@Robinlovelace Robinlovelace left a 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)

@Robinlovelace
Copy link
Member

# 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)

@Robinlovelace
Copy link
Member

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)

@Robinlovelace Robinlovelace merged commit 8f48017 into master Jan 14, 2020
@Robinlovelace Robinlovelace mentioned this pull request Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants