CustomPalette: Create a custom color palette

Description Usage Arguments Value Examples

View source: R/visualization.R

Description

Creates a custom color palette based on low, middle, and high color values

Usage

1
2
3
4
5
6
7
BlackAndWhite(mid = NULL, k = 50)

BlueAndRed(k = 50)

CustomPalette(low = "white", high = "red", mid = NULL, k = 50)

PurpleAndYellow(k = 50)

Arguments

mid

middle color. Optional.

k

number of steps (colors levels) to include between low and high values

low

low color

high

high color

Value

A color palette for plotting

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
plot(df, col = BlackAndWhite())

df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
plot(df, col = BlueAndRed())

myPalette <- CustomPalette()
myPalette

df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
plot(df, col = PurpleAndYellow())

ibseq/scs-analysis documentation built on Feb. 27, 2021, 12:35 a.m.