col: Easy color scale maker

Description Usage Arguments Value Examples

View source: R/col.R

Description

Easy color scale maker

Usage

1
col(x, colors = c("blue", "red"), method = "linear", n, ...)

Arguments

x

A vector (or array) of values corresponded to the colors

colors

A character vector of the base colors to interpolate

method

An interpolation method. Choose from "linear" or "quantile".

n

If 'method' is "quantile", select the number of the division.

...

Undescribed

Value

The interpolated color code

Examples

1
2
3
4
5
6
7
x <- 1:10
plot(x, pch = 19, col = col(x))
plot(x, pch = 19, col = col(-x))

x <- sort(rexp(1000, 10))
plot(x, 1:length(x), pch = 19, col = col(x))
plot(x, 1:length(x), pch = 19, col = col(x, method = "quantile", n = 5))

jundoll/jmisc documentation built on May 20, 2019, 4:24 a.m.