Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

bi_pal

Palette Preview and Hex Values


Description

Prints either a visual preview of each palette or the associated hex values.

Usage

bi_pal(pal, dim = 3, preview = TRUE)

Arguments

pal

A palette name; one of "Brown", "DkBlue", "DkCyan", "DkViolet", or "GrPink".

dim

The dimensions of the palette, either 2 for a two-by-two palette or 3 for a three-by-three palette.

preview

A logical scalar; if TRUE (default), an image preview will be generated. If FALSE, a vector with hex color values will be returned.

Details

The "Brown", "DkBlue", "DkCyan", and "GrPink" palettes were made by Joshua Stevens. The "DkViolet" palette was made by Timo Grossenbacher and Angelo Zehr.

Value

If preview = TRUE, an image preview of the legend will be returned. Otherwise, if preview = FALSE, a named vector with class values for names and their corresponding hex color values.

Examples

# brown palette, 2x2 preview
bi_pal(pal = "Brown", dim = 2)

# brown palette, 2x2 hex values
bi_pal(pal = "Brown", dim = 2, preview = FALSE)

# brown palette, 3x3 preview
bi_pal(pal = "Brown", dim = 3)

# brown palette, 3x3 hex values
bi_pal(pal = "Brown", dim = 3, preview = FALSE)

# dark blue palette, 2x2 preview
bi_pal(pal = "DkBlue", dim = 2)

# dark blue palette, 2x2 hex values
bi_pal(pal = "DkBlue", dim = 2, preview = FALSE)

# dark blue palette, 3x3 preview
bi_pal(pal = "DkBlue", dim = 3)

# dark blue palette, 3x3 hex values
bi_pal(pal = "DkBlue", dim = 3, preview = FALSE)

# dark cyan palette, 2x2
bi_pal(pal = "DkCyan", dim = 2)

# dark cyan palette, 2x2 hex values
bi_pal(pal = "DkCyan", dim = 2, preview = FALSE)

# dark cyan palette, 3x3
bi_pal(pal = "DkCyan", dim = 3)

# dark cyan palette, 3x3 hex values
bi_pal(pal = "DkCyan", dim = 3, preview = FALSE)

# dark violet palette, 2x2
bi_pal(pal = "DkViolet", dim = 2)

# dark violet palette, 2x2 hex values
bi_pal(pal = "DkViolet", dim = 2, preview = FALSE)

# dark violet palette, 3x3
bi_pal(pal = "DkViolet", dim = 3)

# dark violet palette, 3x3 hex values
bi_pal(pal = "DkViolet", dim = 3, preview = FALSE)

# gray pink palette, 2x2
bi_pal(pal = "GrPink", dim = 2)

# gray pink palette, 2x2 hex values
bi_pal(pal = "GrPink", dim = 2, preview = FALSE)

# gray pink palette, 3x3
bi_pal(pal = "GrPink", dim = 3)

# gray pink palette, 3x3 hex values
bi_pal(pal = "GrPink", dim = 3, preview = FALSE)

biscale

Tools and Palettes for Bivariate Thematic Mapping

v0.2.0
GPL-3
Authors
Christopher Prener [aut, cre] (<https://orcid.org/0000-0002-4310-9888>), Timo Grossenbacher [aut], Angelo Zehr [aut], Joshua Stevens [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.