ropensci-archive / scrubr

:warning: ARCHIVED :warning: Clean species occurrence records
Other
34 stars 10 forks source link

Create correct_swap_sign.R #25

Closed AshwinAgrawal16 closed 6 years ago

AshwinAgrawal16 commented 7 years ago

Hi, This pull request is in accordance with the issue #23 (use case: data cleaning paper using GBIF data). I have created a function which will check any switched latitude and longitude and also any sign confusion between the two.

In the suggested function first I download country information from the natural-earth data, then I check for valid location, swapped coordinates and any sign changes. The above function only solves part of the issue, I will also solve remaining part in near future.

Please review the code and if there are any errors or any further requirements please let me know.

Regards Ashwin

sckott commented 7 years ago

hi @AshwinAgrawal16 thanks for this.

These kinds of things don't go in R/, but rather as a vignette or possibly in demos http://r-pkgs.had.co.nz/misc.html - problem with that is we'd still need to have those pkgs in Suggests - for now, please put it in inst/examples - you can just add changes to this PR

AshwinAgrawal16 commented 7 years ago

Sorry for the inconvenience caused. I have moved the file to inst/examples. If there are any further changes requested please let me know.

Regards Ashwin

codecov-io commented 7 years ago

Codecov Report

Merging #25 into master will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##           master      #25   +/-   ##
=======================================
  Coverage   55.25%   55.25%           
=======================================
  Files          15       15           
  Lines         333      333           
=======================================
  Hits          184      184           
  Misses        149      149

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 50036b7...e106878. Read the comment docs.

AshwinAgrawal16 commented 7 years ago

I have coded a pipeline to test all the three functions (checkLocation, correctSign and correctSwap) in the PR. Should I code separate tests for each function or a common pipeline will suffice.

Regards Ashwin

sckott commented 7 years ago

what do you mean by

I have coded a pipeline to test all the three functions

sckott commented 7 years ago

@AshwinAgrawal16 thoughts?

AshwinAgrawal16 commented 7 years ago

Sorry, for late reply. I was kind of busy. I will make this PR merge able as soon as possible. In this I will set up three functions:

  1. Location check- To check whether the location is valid or not.
  2. Check sign- To check the sign of the coordinates.
  3. Check swap- To check the swap of the coordinates.

After applying the 2 and 3 functions I will check the result through the location check (1st function) to check whether modified location is valid.

Apologies for late response.

sckott commented 6 years ago

@AshwinAgrawal16 do you still intend to finish this?

AshwinAgrawal16 commented 6 years ago

I apologize for my very delayed response, but I am very much interested in finishing this task. I will start working on it asap.

Apologies Ashwin

sckott commented 6 years ago

Any thoughts @AshwinAgrawal16 ?