safeBrew {seqsetvis} | R Documentation

## allows RColorBrew to handle n values less than 3 and greater than 8 without warnings and return expected number of colors.

### Description

allows RColorBrew to handle n values less than 3 and greater than 8 without warnings and return expected number of colors.

### Usage

    safeBrew(n, pal = "Dark2")

### Arguments

`n` | integer value of number of colors to make palette for
`pal` | palette recognized by RColorBrewer

### Value

a character vector of hex coded colors o flength n from the color brewer palette pal

### Examples

    plot(1:2, rep(0, 2),  col = safeBrew(2, "dark2"), pch = 16, cex = 6)
    plot(1:12, rep(0, 12),  col = safeBrew(12, "set1"), pch = 16, cex = 6)
    plot(1:12, rep(0, 12),  col = safeBrew(12, "set2"), pch = 16, cex = 6)
    plot(1:12, rep(0, 12),  col = safeBrew(12, "set3"), pch = 16, cex = 6)

[Package seqsetvis version 1.10.0 Index]