###R package for geographical maps
This is version 3 of the maps package. The main change with respectto v2 is a more recent world map. The old map legacy map is stillavailable from the package mapdata.
##CHANGES
##ADDITIONS
v3.1 includes support for ‘SpatialPolygons’ and ‘SpatialLines’classes. Such objects can now either be passed to map() directly orfirst be converted to a map-type list with the new functions‘SpatialPolygons2map()’ and ‘SpatialLines2map’. These functions do notcopy all the information present in the original data: only polygonnames and co-ordinates are preserved (additional information like holes,plotting order etc. is ignored).
A new databse ‘lakes’ has been added. The standard ‘world’ map nolonger contains any lakes.
A data frame iso3166 has been added which, for every country onthe new world map, lists the official name, the ISO3166 2- and 3-lettercodes, and also the sovereignty. Type ‘?iso3166’ for details.
A set of simple functions use this iso3166 table for creating alist of countries to map. So you can use the 2- or 3-letter ISO code(e.g. as country labels on a map), but also create a list based on thesovereignty. Type ‘?iso.expand’ for details.
v3.2 adds new options to map() for wrapping and exact boundaryclipping.
v3.4.3 adds initial support for ‘sf’ class maps.
##FIXES - As of v3.2, maps::map() also works if the maps package isnot attached. You can even do maps::map(“madata::worldHires”). - As ofv3.1, map(…, fill=TRUE) no longer applies thinning. This removes smallartefacts, but plotting worldHires becomes rather slow, should you everwant to plot a full world map at such a high resolution. - map.text(…,exact=TRUE) now behaves as documented. Previously, the “exact=TRUE” wasnot passed to the map drawing if add=FALSE. To get the old(non-documented) behaviour (plot map with exact=FALSE, write text forexact=TRUE) you should now use 2 commands: * > map(…, exact=FALSE) *> map.text(…, exact=TRUE, add=TRUE) - match.map now works correctlyfor regions containing “:”. This was potentially broken due tolocale-dependent behaviour of order(). - ‘world2’ now has cleanboundaries when ‘fill=TRUE’.
##FALL BACK TO LEGACY WORLD DATABASE The old map data set has beenmoved to the ‘mapdata’ package, where it is called “worldLores”. It canthus be called via map(“mapdata::worldLores”).
Note that the worldHires database from the mapdata package hasidentical map naming than the legacy world map. The only difference isin the resolution of the polylines. That high resolution version of thelegacy map will remain unchanged.
Please inform the maintainer of any problem that requires a fallbackto the legacy database!
Natural Earth also supports a high-resolution (1:10m) world map.Rather than replacing ‘worldHires’ (in the mapdata package), this dataset can be imported into maps e.g. by loading the “rnaturalearth”package.
Even maps in e.g. shapefile format can now easily be imported for usein ‘map()’. For instance the package ‘maptools’ offers the function‘readShapePoly()’, which reads a shapefile into a‘SpatialPolygonsDataFrame’ that can be used as a map database (as ofversion 3.1).
##TO DO/DISCUSS: - The old naming convention is largely maintained,but some choices are different. The changes mean thate.g. /region=“France”/ now covers only metropolitan France, whithout(most of) the overseas departments and territories - Someinconsistencies in the naming procedure remain. For instance, while mostcountries are named by their full name, “UK” and “USA” are shortened inthe same way as in the old data base. For UK, this even required a hackin the mapping code to avoid adding Ukrain to the map. - The iso3166table may have to be adapted for the Natural Earth 1:10 database, someextra rows have already been inserted.