Message-ID: <20874881.post@talk.nabble.com>
Date: 2008-12-06T21:37:41Z
From: zerfetzen
Subject: Help with maps
In-Reply-To: <146226004784664368740002202494514611103-Webmail@me.com>
I'm brand new to the map function too, here's my attempt at coloring a map of
the states according to a rate (rather than count):
map('state')$names
MyCount <- c(1:63); MyRate <- runif(63, 0, 1)
map('state', fill=TRUE, col=rgb((1-MyRate),MyRate,0,1))
Seeing that there are 63 "states", means you'll have to adjust your data to
fit. For example, look at Washington. I think the effect of MyRate on
color is that as it approaches 1, rgb produces green, and as it approaches
0, rgb produces red. I know you were asking for counts, but I just had this
handy, and I'm learning too. Cheers.
--
View this message in context: http://www.nabble.com/Help-with-maps-tp20804115p20874881.html
Sent from the R help mailing list archive at Nabble.com.