Description Usage Arguments Value Author(s) Examples
View source: R/colordiverger.R
A function that takes two colors as its input and produces a color palette for plotting (z-scored) values (e.g. in a heatmap) with two diverging colors.
1 2 3 4 5 6 | colordiverger(
color1 = "mediumpurple",
color2 = "tan",
min.val = -5,
max.val = 5
)
|
color1 |
a color of R's predefined color names which is available in 4 graduations with names as follows (for the example of cyan): cyan1, cyan2, cyan3, cyan4; you may check availability online or within R with 'colors()'; color1 defines the color for all negative values; default: "mediumpurple" |
color2 |
a color with the same demands as defined for color1; color2 defines the color for all positive values; default: "tan" |
min.val |
specifies the minimum value of the dataset the palette will be prepared for; the palette follows z-score graduations; default: -5 |
max.val |
specifies the maximum value of the dataset the palette will be prepared for; default: 5 |
customized diverging color palette
Paul Volkmann
1 | my_color_palette <- colordiverger("springgreen", "steelblue")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.