[R] thematic map of USA

Duncan Murdoch murdoch at stats.uwo.ca
Mon Aug 4 20:07:50 CEST 2008


On 04/08/2008 1:14 PM, John P. Burkett wrote:
> My goal is to prepare a thematic map of the US, with states shaded 
> according to their values for a variable of interest.  I would like to 
> include an inset for Alaska in the upper left and an inset for Hawaii in 
> the lower left. If possible, I'd like to use Albers conic projection, or 
> something similar.  Thus far I have tried using the maps package with 
> its state database (which omits Alaska and Hawaii) and the gmaps package 
> (which places an inset for Alaska in the lower left and uses a 
> projection [Miller cylindrical?] that distorts states along the northern 
> and southern fringe). I would be very grateful for suggestions about 
> alternative approaches.

Alaska and Hawaii are in the world map, coded as regions USA:Alaska and 
Hawaii:Hawaii.

I believe you can plot the states data, then add Alaska and Hawaii at 
locations of your choice afterwards.  I don't know how to do multiple 
regions on the same plot, but here's how to do the components:

map("state", projection="albers", parameters=c(25,40))

map("world2Hires", "USA:Alaska", projection="albers", parameters=c(55, 70))

map("world2Hires", "Hawaii", projection="albers", parameters=c(15, 25))

This needs the mapdata package for world2Hires, and (I think) the 
mapproj package for the Albers projections.

Duncan Murdoch



More information about the R-help mailing list