Skip to content
Prev 349689 / 398506 Next

Color US counties on US map using a numeric variable for color intensity

Dimitri,

To answer your questions:
The colorRamp() function creates a new function, newpal().
The value returned by newpal() is a numeric matrix of RGB color values.
The rgb() function is then used to convert this numeric matrix to colors,
with the argument maxColorValue
giving the maximum of the color values range.  Typically either 255 or 1.
See the help files for more information

?colorRamp
?rgb


I think Jim Lemon's suggestion to use color.scale() function is a handier
solution.

Jean

On Thu, Apr 2, 2015 at 6:05 PM, Dimitri Liakhovitski <
dimitri.liakhovitski at gmail.com> wrote: