Comments (5)
Not looked at this since raising the issue.
from covidregionaldata.
Thanks for this @tjtnew,
Did you have luck determining if this was a feature of the data or due to our processing issues?
from covidregionaldata.
It looks like a processing issue from my inspection, inside get_authority_lookup_table. I think, e.g., the upper_tier_auth and ni_auth have the same region2 information in them, and when the rows are combined the region2 information then appears twice.
authority_lookup_table <- get_authority_lookup_table()
authority_lookup_table %>% group_by(region_level_2) %>% tally() %>% filter(n > 1)
# A tibble: 15 x 2
region_level_2 n
<chr> <int>
1 Antrim and Newtownabbey 2
2 Ards and North Down 2
3 Armagh City, Banbridge and Craigavon 2
4 Belfast 2
5 Causeway Coast and Glens 2
6 Derry City and Strabane 2
7 Dumfries and Galloway 2
8 Fermanagh and Omagh 2
9 Fife 2
10 Highland 2
11 Lisburn and Castlereagh 2
12 Mid Ulster 2
13 Mid and East Antrim 2
14 Newry, Mourne and Down 2
15 Powys 2
This duplication can be removed by going:
authority_lookup_table <- authority_lookup_table %>% dplyr::arrange(level_1_region_code) %>% dplyr::distinct(level_2_region_code, region_level_2, .keep_all = TRUE)
Note the arrange is required to ensure the NA level_1_region_codes are sorted to the bottom so the distinct step removes them.
Happy to submit this as a pull request if you like; please let me know.
from covidregionaldata.
Thanks very much for looking at this and identifying exactly where the error is @rboyes . I hadn't checked back on this code in a while, great to have someone else look at it. This should now be fixed in master, using your code (plus a very slightly cleaner lookup process).
from covidregionaldata.
@rboyes - I should have mentioned this earlier, we will add you as a package contributor (#83) unless you let us know otherwise. Thanks again
from covidregionaldata.
Related Issues (20)
- Add tests for download_JSON and JSON_reader HOT 2
- Add memoise support for download_JSON HOT 1
- Update package logo with new datasets HOT 1
- Review depreciated features HOT 2
- HTTP error 502 when downloading Vietnam's json data HOT 6
- Upstream data changes break our regional code - Colombia, Cuba, India, United States HOT 11
- Check if some required packages could be made suggested HOT 4
- Switch to preferably pkgdown theme HOT 3
- Giant package logo in web docs HOT 6
- Vietnam handles province labels badly, possible str_conv issue
- We've also made a fix to `complete()` to ensure that it always works as expected with grouped data frames. One of the results of this fix is that you can no longer supply group variables to `complete()` (if you have a grouped data frame, `complete()` will work "within" each group so you shouldn't have access to them). See https://github.com/tidyverse/tidyr/pull/1300 for more details. HOT 2
- Warnings from countrycode
- Vietnam data timing out HOT 1
- Colombia failing download tests
- Italian COVID-19 Integrated Surveillance Data HOT 19
- Run country-specific tests when relevant files are modified HOT 2
- France has moved their data - this breaks slowstart
- France has moved their data - we need to use a new upstream source HOT 1
- covidregionaldata archived on CRAN HOT 3
- South Africa new reported cases around higher than Our World In Data/WHO HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from covidregionaldata.