colorpal: Create expanded color palette

View source: R/colorpal.R

colorpalR Documentation

Create expanded color palette

Description

Creates an expanded color palette from an existing color palette by interpolating new colors.

Usage

colorpal(pal, n)

Arguments

pal

A vector of colors

n

Number of colors to be interpolated

Value

An expanded vector of colors

Examples

# Make 15 color palette from 11 color red-blue palette
library(RColorBrewer)
colorpal(brewer.pal(11, "RdBu"), 15)

cfree14/freeR documentation built on Aug. 22, 2023, 11:12 p.m.