Functions to create color palettes.
The functions are:
||Contiguous rainbow color palette,|
||Contiguous heat color palette,|
||Contiguous terrain color palette,|
||Contiguous topo color palette,|
||Contiguous cm color palette,|
||R's gamma-corrected gray palette,|
||Tim's Matlab like color palette,|
||Color ramp palettes,|
||Sequential color brewer palettes,|
||Diverging color brewer palettes,|
||Qualified color brewer palettes,|
||Red, green blue focus palettes,|
||Red, green blue mono palettes.|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
rainbowPalette(n = 64, ...) heatPalette(n = 64, ...) terrainPalette(n = 64, ...) topoPalette(n = 64, ...) cmPalette(n = 64, ...) greyPalette(n = 64, ...) timPalette(n = 64) rampPalette(n, name = c("blue2red", "green2red", "blue2green", "purple2green", "blue2yellow", "cyan2magenta")) seqPalette(n, name = c( "Blues", "BuGn", "BuPu", "GnBu", "Greens", "Greys", "Oranges", "OrRd", "PuBu", "PuBuGn", "PuRd", "Purples", "RdPu", "Reds", "YlGn", "YlGnBu", "YlOrBr", "YlOrRd")) divPalette(n, name = c( "BrBG", "PiYG", "PRGn", "PuOr", "RdBu", "RdGy", "RdYlBu", "RdYlGn", "Spectral")) qualiPalette(n, name = c( "Accent", "Dark2", "Paired", "Pastel1", "Pastel2", "Set1", "Set2", "Set3")) focusPalette(n, name = c("redfocus", "greenfocus", "bluefocus")) monoPalette(n, name = c("redmono", "greenmono", "bluemono"))
an integer, giving the number of greys or colors to be constructed.
a character string, the name of the color set.
arguments to be passed, see the details section
All Rmetrics' color sets are named as
fooPalette where the
foo denotes the name of the underlying color set.
R's Contiguous Color Palettes:
n contiguous colors are implemented in the
grDevices package. To be conform with Rmetrics' naming
convention for color palettes we have build a wrapper around the
underlying functions. These are the
topoPalette, and the
Conceptually, all of these functions actually use (parts of) a line
cut out of the 3-dimensional color space, parametrized by the function
gamma=1 for the
function, and hence, equispaced hues in RGB space tend to cluster at
the red, green and blue primaries. Some applications such as contouring
require a palette of colors which do not wrap around to give a final
color close to the starting one. To pass additional arguments to the
underlying functions we refer to consult
With rainbow, the parameters start and end can be used to specify
particular subranges of hues. Synonyme function calls are
topo.colors, and the
R's Gamma-Corrected Gray Palette:
grayPalette chooses a series of
gamma-corrected gray levels. The range of the gray levels can be
optionally monitored through the
... arguments, for
help(gray.colors), which is a synonyme function call
Tim's Matlab like Color Palette:
timPalette creates a color set ranging from blue
to red, and passes through the colors cyan, yellow, and orange. It
comes from the Matlab software, originally used in fluid dynamics
simulations. The function here is a copy from R's contributed package
fields doing a spline interpolation on
n=64 color points.
Color Ramp Palettes:
rampPalette creates several color ramps. The
function is implemented from Tim Keitt's contributed R package
Supported through the argument
name are the following color
Color Brewer Palettes:
qualiPalette create color sets according to R's
RColorBrewer package. The first letter in the
function name denotes the type of the color set: "s" for
sequential palettes, 'd" for diverging palettes, and "q" for
Sequential palettes are suited to ordered data that progress from low to high. Lightness steps dominate the look of these schemes, with light colors for low data values to dark colors for high data values. The sequential palettes names are: Blues, BuGn, BuPu, GnBu, Greens, Greys, Oranges, OrRd, PuBu, PuBuGn, PuRd, Purples, RdPu, Reds, YlGn, YlGnBu, YlOrBr, YlOrRd.
Diverging palettes put equal emphasis on mid-range critical values and extremes at both ends of the data range. The critical class or break in the middle of the legend is emphasized with light colors and low and high extremes are emphasized with dark colors that have contrasting hues. The diverging palettes names are: BrBG, PiYG, PRGn, PuOr, RdBu, RdGy, RdYlBu, RdYlGn, Spectral.
Qualitative palettes do not imply magnitude differences between legend classes, and hues are used to create the primary visual differences between classes. Qualitative schemes are best suited to representing nominal or categorical data. The qualitative palettes names are: Accent, Dark2, Paired, Pastel1, Pastel2, Set1, Set2, Set3.
In contrast to the original color brewer palettes, the palettes here are created by spline interpolation from the color variation with the most different values, i.e for the sequential palettes these are 9 values, for the diverging palettes these are 11 values, and for the qualitative palettes these are between 8 and 12 values dependeing on the color set.
Graph Color Palettes:
perfanPalette creates color sets inspired
by R's cotributed package
These color palettes have been designed to create readable,
comparable line and bar graphs with specific objectives.
Focused Color Palettes: Color sets designed to provide focus to the data graphed as the first element. This palette is best used when there is clearly an important data set for the viewer to focus on, with the remaining data being secondary, tertiary, etc. Later elements graphed in diminishing values of gray.
Monchrome Color Palettes: These include color sets for monochrome color displays.
returns a character string of color strings.
The palettes are wrapper functions provided in several contributed R packages. These include:
Cynthia Brewer and Mark Harrower for the brewer palettes,
Peter Carl and Brian G. Peterson for the "PerformanceAnalytics" package,
Tim Keitt for the "colorRamps" package,
Ross Ihaka for the "colorspace" package,
Tomas Aragon for the "epitools" package,
Doug Nychka for the "fields" package,
Erich Neuwirth for the "RColorBrewer" package.
Additional undocumented hidden functions:
||Converts any R color to RGB (red/green/blue),|
||Changes from one to another number system,|
||Converts heximal numbers do decimal numbers,|
||Converts decimal numbers do heximal numbers.|
## GreyPalette: greyPalette()