I have a list of latitude and longitude coordinates, and wish to find out which country they all reside in.
I modified an answer from this question about lat-long to
You can use my geonames package to lookup from the http://geonames.org/ service:
> GNcountryCode(51.5,0)
$languages
[1] "en-GB,cy-GB,gd"
$distance
[1] "0"
$countryName
[1] "United Kingdom of Great Britain and Northern Ireland"
$countryCode
[1] "GB"
> GNcountryCode(44.5,20)
$languages
[1] "sr,hu,bs,rom"
$distance
[1] "0"
$countryName
[1] "Serbia"
$countryCode
[1] "RS"
Get it from r-forge because I'm not sure I bothered to release it to CRAN:
https://r-forge.r-project.org/projects/geonames/
Yes, it depends on an external service, but at least it knows what happened to communism... :)