make_color_vector: Make a color vector

View source: R/make_color_vector_function.R

make_color_vectorR Documentation

Make a color vector

Description

Function that takes a vector of values and a desired color palette and returns color values that correspond to each vector value.

Usage

make_color_vector(vec, palette = NA, min = NA, max = NA, step = 1, alpha = 1)

Arguments

vec

Value vector

min

Minimum value to consider for the scaling of the color values (may subceed the value vector)

max

Maximum value to consider for the scaling of the color values (may exceed the value vector)

step

Step width between values to consider for the scaling of the color values

alpha

Transparency from 0 = fully transparent to 1 = fully opaque

col.palette

Color palette, e.g. default R palettes or created with colorRampPalette function

Value

Vector of color codings with the same length and order as the input vector

Author(s)

Nikolai Knapp

Examples

in progress

niknap/slidaRtools documentation built on Oct. 16, 2024, 3:53 p.m.