library(maps)
1> map.where(database="world",29.392089,53.592505)
[1] "USSR"
does anyone know how I can get an updated world map database to drive this function in the maps package? I need country names only for now, not detailed sub-national administrative information such as is available in at gadm.org.
Try
wrld_simpl
in themaptools
package.I don't know how up to date it is, but
?wrld_simpl
describes the source so you might find good stuff following links. Other packages that rely onsp
will also be worth exploring for data.Otherwise, there was the Rgshhs package, though I'm not sure that's still available. It came with fair detail but you can download more if you need it. It's a bit complicated, the original data is here: http://www.ngdc.noaa.gov/mgg/shorelines/gshhs.html
You can also read in data from vector formats (like MIF or SHP or PostGIS) using
rgdal
if you have your own data, or similar read functions inmaptools
for shapefile only.Example to query the objects using points:
For an introduction to these and other functions in
sp
see vignette("sp").Also try the
geonames
package for more general querying of geographic names.