Repository navigation
sle_adm3: regenerate the stored object so validTo is NA - #49
Merged
Merged
Conversation
data/sle_adm3.rda carried validTo = -1-11-30 in all 167 rows, a sentinel an older GDAL wrote for the shapefile's empty date field. Rebuilt from inst/extdata/sle_adm3.zip with data-raw/sle_adm3.R under sf 1.1.1 / GDAL 3.4.1; the object now equals sf::read_sf() on the zip in every column. A sweep of all 103 stored datasets (210 Date/POSIXct columns and the nested objects) found no other pre-1900 date. Version 0.0.0.9013, NEWS entry.
Contributor
|
@raubreywhite The fix worked, but only by accident: it was built once under an old GDAL version, and the data-raw/sle_adm3.R script itself didn't actually handle the sentinel (so re-running it on a newer GDAL (like on my computer) reproduced the original bug. I patched data-raw/sle_adm3.R to explicitly convert any implausible pre-1900 date to NA, regardless of GDAL version, then regenerated data/sle_adm3.rda from that fixed script (the data itself didn't change, it's just now reproducible). Bumped up the version of the data in the tableoftables.xlsx as well! The ID now would be Tested on my computer and looks fine! @jarvisc1 Ill merge now and update the package to V0.0.0.9013 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #48.
get_data(name = "sle_adm3")returnedvalidTo = -1-11-30in all 167 rows; the shapefile field is empty (NA). The stored.rdahad been built with an older GDAL that wrote a sentinel for the empty date. This PR rebuildsdata/sle_adm3.rdafrominst/extdata/sle_adm3.zipwith the existingdata-raw/sle_adm3.Runder sf 1.1.1 / GDAL 3.4.1, so the object equalssf::read_sf()on the zip in every column (names, 167 rows, classes, CRS, geometry). Old and new differ in that one column only.A sweep of all 103 stored datasets (210 Date/POSIXct columns, plus the nested epinow, stars and phylo objects) found no other pre-1900 date;
sle_hf,Blocksshape,Quartiersshapeandgis_africa_countriescarry no date columns.Version 0.0.0.9013 and a NEWS entry. No code change.
Check after install:
Downstream: the Epidemiologist R Handbook's GIS chapter switch to
get_data()(appliedepi/epirhandbook#446) waits on this, followed by a pin bump in aedockerpublic (appliedepi/aedockerpublic#2).