Last data update: 2014.03.03

R: Make Color Scale
make.color.scaleR Documentation

Make Color Scale

Description

Construct 2 color gradient for the function 'wordcloud'.

Usage

make.color.scale(aColor, bColor, steps, gradientExp=.5)

Arguments

aColor

The starting color of the gradient

bColor

The ending color of the gradient

steps

The number of elements in the outpus gradient vector

gradientExp

A parameter for controlling the interpolation between the 2 colors. a value of 1 will yield straight linear interpolation between the colors. A value lessthan 0 will cause the gradient to rapidly transition and plateau into the the second color,

Value

A vector of colors (represented by character strings) giving a smooth transition between the 2 input colors.

Examples

# Make a cyan to red gradient with 10 steps.
make.color.scale(c(0,1,1), c(1,0,0),10,1)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(DeducerText)
Loading required package: Deducer
Loading required package: ggplot2
Loading required package: JGR
Loading required package: rJava
Loading required package: JavaGD
Loading required package: iplots

Please type JGR() to launch console. Platform specific launchers (.exe and .app) can also be obtained at http://www.rforge.net/JGR/files/.


Loading required package: car
Loading required package: MASS


Note Non-JGR console detected:
	Deducer is best used from within JGR (http://jgr.markushelbig.org/).
	To Bring up GUI dialogs, type deducer().

Loading required package: tm
Loading required package: NLP

Attaching package: 'NLP'

The following object is masked from 'package:ggplot2':

    annotate

Loading required package: wordcloud
Loading required package: RColorBrewer
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/DeducerText/make.color.scale.Rd_%03d_medium.png", width=480, height=480)
> ### Name: make.color.scale
> ### Title: Make Color Scale
> ### Aliases: make.color.scale
> 
> ### ** Examples
> 
> # Make a cyan to red gradient with 10 steps.
> make.color.scale(c(0,1,1), c(1,0,0),10,1)
 [1] "#00FFFF" "#1CE3E3" "#39C6C6" "#55AAAA" "#718E8E" "#8E7171" "#AA5555"
 [8] "#C63939" "#E31C1C" "#FF0000"
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>