Learn R Programming

LorMe (version 1.1.0)

color_scheme: Get color scheme

Description

color_scheme() can generate color scheme from nine color scheme database and expand into colorRamp

Usage

color_scheme(Plan, expand = NULL, names = NULL, show = TRUE)

Value

If parameter 'names' is not given, 'color_scheme' returns character string including color scheme.When 'names' is set,'color_scheme' returns named vector of color scheme.

Arguments

Plan

Character, 'Plan1' to 'Plan10' are optional.

expand

Numeric, default:NULL. Numeric indicating numbers to expand color scheme into colorRamp

names

Character string. Names to assign for color scheme.

show

Logical. If show assigned color in plot panel. Default:TRUE.

Examples

Run this code
### Commonly used example ###
my_color <- color_scheme(
  Plan = "Plan1",
  names = c("Treatment1", "Treatment2")
)

### Generate colorRamp still based on 'Plan1'
my_color <- color_scheme(
  Plan = "Plan1",
  expand = 4,
  names = c("Treatment1", "Treatment2", "Treatment3", "Treatment4")
)

### View color scheme from plan1 to plan10 in 'Plots' interface ###
color_scheme(Plan = "Plan1")
color_scheme(Plan = "Plan2")
color_scheme(Plan = "Plan3")
color_scheme(Plan = "Plan4")
color_scheme(Plan = "Plan5")
color_scheme(Plan = "Plan6")
color_scheme(Plan = "Plan7")
color_scheme(Plan = "Plan8")
color_scheme(Plan = "Plan9")
color_scheme(Plan = "Plan10")

Run the code above in your browser using DataLab