map_values_to_colors: Map a vector of values to hex colors

Description Usage Arguments Value Author(s) Examples

View source: R/format_data.R

Description

Map a vector of values to hex colors

Usage

1
2
map_values_to_colors(values, color_type = "discrete", color_cutoff = 0,
  pallete = "RdBu")

Arguments

values

numeric vector of values

color_type

type of color palette to map values to (discrete or continous)

color_cutoff

value which seperates values into higher or lower for discrete color mapping

palette

RColorBrewer pallete name, viridis palette name (if continous), or two colors to create a colorRampPalette from.

Value

vector of hex colors

Author(s)

Beth Signal

Examples

1
2
3
4
map_values_to_colors(seq(-4, 5))
map_values_to_colors(seq(-4, 5), color_type = "continous")
map_values_to_colors(seq(-4, 5), color_type = "continous", pallete = "magma")
map_values_to_colors(seq(-4, 5), color_type = "continous", pallete = c("lightblue", "blue"))

betsig/ipath documentation built on March 12, 2021, 12:06 a.m.