[R] thematic maps, missing data, gmap

John P. Burkett burkett at uri.edu
Sat Aug 2 22:40:16 CEST 2008

Running R version 2.6.1 under Gentoo Linux, I'm trying to produce a 
thematic map of the USA using the gmap package and its function 
USALevelPlot.  The variable whose levels are to be plotted is observed 
for 49 states but missing for one (Delaware).

I would like to produce a map in which the states for which data exist 
are shaded and Delaware is represented only by an outline.  In contrast 
the command
produces a map in which Delaware's borders with New Jersey and Maryland 
appear (because data for the latter two states are observed) but 
Delaware's coastline is omitted.  The result looks like there is a bay 
where Delaware should be.  If anyone could suggest a method for drawing 
in the missing coastline or Delaware's complete boundary, I would be 
most grateful.

My .R code for the map is as follows:
********Code starts here**********************************************
grid.frame(name="map") # Create a frame for packing objects.
statenames <- list("Alabama", "Alaska", "Arizona", "Arkansas",
              "California", "Colorado", "Connecticut",
              "Florida", "Georgia", "Hawaii", "Idaho",
              "Illinois", "Indiana", "Iowa", "Kansas",
              "Kentucky", "Louisiana", "Maine", "Maryland",
              "Massachusetts", "Michigan", "Minnesota", "Mississippi",
              "Missouri", "Montana", "Nebraska", "Nevada",
              "New Hampshire", "New Jersey", "New Mexico", "New York",
              "North Carolina", "North Dakota", "Ohio", "Oklahoma",
              "Oregon", "Pennsylvania", "Rhode Island", "South Carolina",
              "South Dakota", "Tennessee", "Texas", "Utah",
              "Vermont", "Virginia", "Washington", "West Virginia",
              "Wisconsin", "Wyoming") # Delaware is not observed

**************Code ends here*******************************************
If the data would be helpful, I can supply them.


John P. Burkett
Department of Environmental and Natural Resource Economics
and Department of Economics
University of Rhode Island
Kingston, RI 02881-0808

phone (401) 874-9195

More information about the R-help mailing list