I have a dataset that has 3 Million+ Rows, part of that dataset contains Latitude and Longitude coordinates and I need to run a check against those co-ordinates, bring back the country and then compare that country against the country already in the dataset.
The suggestion to use the maps package in an older post (Fastest way to determine COUNTRY from millions of GPS coordinates [R]) is brilliant, however that package leaves me with around 190,000 NA values even though the coordinates are 100% valid (I have checked them in other online services).
Example of some entries that should have a match, but do not match:
LONGITUDE LATITUDE 1.3346258 51.96007 1.34711853 51.96614 1.33469456 51.95923 1.21408338 52.94419 1.74703244 52.47744 1.30218822 52.9191
So, what I need is for a package like maps that has all of the geocodes (world wide).
Most of the alternatives I have found so far are either paid alternatives or have search limits.
Even if I run using my existing code first and then run those that result in NA and rejoin would do.
Example of my code, should anyone need it is Latest[, COUNTRY := map.where(x = LONGITUDE, y = LATITUDE)]