Re: [R] help color coding map in R

2010-05-18 Thread Anderson, Chris
, Chris Cc: R-help Forum Subject: Re: [R] help color coding map in R Sorry, I was talking nonsense. The actual problem was in your panel function, where you extract the state boundaries, and then draw them using panel.polygon: the order of states from map() is arbitrary, and does not correspond to

Re: [R] help color coding map in R

2010-05-17 Thread Felix Andrews
airs > wk: 925-677-4870 > cell: 707-315-8486 > Fax:925-677-4670 > > > -Original Message----- > From: foolish.andr...@gmail.com [mailto:foolish.andr...@gmail.com] On Behalf > Of Felix Andrews > Sent: Saturday, May 15, 2010 6:41 AM > To: Anderson, Chris > C

Re: [R] help color coding map in R

2010-05-15 Thread Felix Andrews
The 'groups' argument should be a factor, which explicitly defines the ordering of its levels. Otherwise it is converted to a factor using the default ordering which is alphabetical. You can make a factor ordered by occurence as, eg., factor(z, levels = unique(z)). Or use reorder(). Note that data

[R] help color coding map in R

2010-05-14 Thread Anderson, Chris
I am trying to create a map with selected states based on highest to lowest mean cost. The following code properly selects the correct states, and the legend is properly color coded with ranges, but the colors per range does not match the state colors. I need help getting the state colors to mat