Learn R Programming

kableExtra (version 0.6.0)

spec_color: Generate viridis Color code for continuous values

Description

Generate viridis Color code for continuous values

Usage

spec_color(x, alpha = 1, begin = 0, end = 1, direction = 1,
  option = "D", na_color = "#BBBBBB")

Arguments

x

continuous vectors of values

alpha

The alpha transparency, a number in [0,1], see argument alpha in hsv.

begin

The (corrected) hue in [0,1] at which the viridis colormap begins.

end

The (corrected) hue in [0,1] at which the viridis colormap ends.

direction

Sets the order of colors in the scale. If 1, the default, colors are ordered from darkest to lightest. If -1, the order of colors is reversed.

option

A character string indicating the colormap option to use. Four options are available: "magma" (or "A"), "inferno" (or "B"), "plasma" (or "C"), and "viridis" (or "D", the default option).

na_color

color code for NA values