[R-sig-Geo] need to create US map with colors by state
Greg Snow
Greg.Snow at imail.org
Thu Nov 5 19:49:51 CET 2009
The help page for state.vbm in the TeachingDemos package shows an example of doing this. The procedure is similar for other maps that can be imported and plotted using the sp and maptools packages. The tricky part is to make sure that your color specifications line up properly with the data and the polygons, this is most important when a single state is made up of multiple polygons (one advantage of state.vbm is that it is 1 polygon per state).
Hope this helps,
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111
> -----Original Message-----
> From: r-sig-geo-bounces at stat.math.ethz.ch [mailto:r-sig-geo-
> bounces at stat.math.ethz.ch] On Behalf Of Mark Kimpel
> Sent: Thursday, November 05, 2009 10:14 AM
> To: r-sig-geo at stat.math.ethz.ch
> Subject: [R-sig-Geo] need to create US map with colors by state
>
> I need to do something quite simple, but a search of the "CRAN Task
> View:
> Analysis of Spatial Data" has not revealed to me the best way to do
> this.
> What I would like to do is plot a map of the U.S. with each state's
> color
> corresponding to heatmap colors of a population statistic. For example,
> dark
> red could be a state with the highest number of H1N1 cases, pink with
> an
> intermediate number, and white with no cases. An ability to overlay the
> center of the state with the actual statistic would be nice but not
> necessary.
>
> Is there a straightforward method to accomplish this? A vignette
> perhaps?
>
> Thanks,
>
> Mark
>
> Mark W. Kimpel MD ** Neuroinformatics ** Dept. of Psychiatry
> Indiana University School of Medicine
>
> 15032 Hunter Court, Westfield, IN 46074
>
> (317) 490-5129 Work, & Mobile & VoiceMail
> (317) 399-1219 Skype No Voicemail please
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
More information about the R-sig-Geo
mailing list