-
Notifications
You must be signed in to change notification settings - Fork 18
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
get_stats19 #239
Comments
Not sure but agree it could be clearer. I will look to fix this. The main issue is that data only exists per year for last 5 years, before that we should default to the huge 1979-2023 dataset. Thanks for reporting and any further feedback or ideas for fix let me know, does the plan outlined above sound good to you (such that if you set |
It sounds a good plan. Thanks for the updating. |
I think this error is from the find_file_name function in the utils module. It is searching for a file mentioning the specific year, which as Robin says doesn't exist for anything before 2018.
I changed it to this. The only change is the first part, but including the full function so can cut and paste.
This was included in the pull request from last week, which I am using on my machine, but is failing the automated checks, if anyone has a chance to have a look. I also wondered since so much effort has gone into utilising the local store of the downloaded data it might be helpful to add an extra step to split the 1979-2023 dataset into years. So each file is saved as type_year.RDS and other functions work off that. Would add a little bit of time to the import step, but speed up analysis of multiple years? |
Set year to 1979 if earlier than 2018, close #239
When I am using:
get_stats19(year = 2005, type = "accidents", data_dir = "XXX"), directory has been replaced. I got error
No files of that type found for that year.
No files found. Check the stats19 website on data.gov.uk
Files identified:
Error in if (data_already_exists) { : argument is of length zero
But when I am using:
get_stats19(year = 2005 - 2024, type = "accidents", data_dir = "XXX")
I can download the data from 1979 to 2023, which includes 2005 data.
Why would this be happening?
The text was updated successfully, but these errors were encountered: