This function returns a vector of color names corresponding to a range of colors specified in the arguments.
Usage
myPalette(low = "white", high = c("green", "red"), mid=NULL, k =50)
Arguments
low
Color for the lower end of the color palette, specified using any of the three kinds of R colors, i.e., either a color name (an element of colors), a hexadecimal string of the form "#rrggbb", or an integer i meaning palette()[i].
high
Color for the upper end of the color palette, specified
using any of the three kinds of R colors, i.e., either a color name
(an element of colors), a hexadecimal string of the form
"#rrggbb", or an integer i meaning palette()[i].
mid
Color for the middle portion of the color palette, specified using any of the three kinds of R colors, i.e., either a color name (an element of colors), a hexadecimal string of the form "#rrggbb", or an integer i meaning palette()[i].
k
Number of colors in the palette.
Value
A "character" vector of color names. This can be used to create a user-defined color palette for subsequent graphics by palette, in a col= specification in graphics functions, or in par.
par(mfrow=c(1,4))
pal <- myPalette(low="red", high="green")
ColorBar(seq(-2,2, 0.2), col=pal, horizontal=FALSE, k=21)
pal <- myPalette(low="red", high="green", mid="yellow")
ColorBar(seq(-2,2, 0.2), col=pal, horizontal=FALSE, k=21)
pal <- myPalette()
ColorBar(seq(-2,2, 0.2), col=pal, horizontal=FALSE, k=21)
pal <- myPalette(low="purple", high="purple",mid="white")
ColorBar(seq(-2,2, 0.2), col=pal, horizontal=FALSE, k=21)
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(GLAD)
######################################################################################
Have fun with GLAD
For smoothing it is possible to use either
the AWS algorithm (Polzehl and Spokoiny, 2002,
or the HaarSeg algorithm (Ben-Yaacov and Eldar, Bioinformatics, 2008,
If you use the package with AWS, please cite:
Hupe et al. (Bioinformatics, 2004, and Polzehl and Spokoiny (2002,
If you use the package with HaarSeg, please cite:
Hupe et al. (Bioinformatics, 2004, and (Ben-Yaacov and Eldar, Bioinformatics, 2008,
For fast computation it is recommanded to use
the daglad function with smoothfunc=haarseg
######################################################################################
New options are available in daglad: see help for details.
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/GLAD/myPalette.Rd_%03d_medium.png", width=480, height=480)
> ### Name: myPalette
> ### Title: Microarray color palette
> ### Aliases: myPalette
> ### Keywords: color
>
> ### ** Examples
>
>
> par(mfrow=c(1,4))
> pal <- myPalette(low="red", high="green")
> ColorBar(seq(-2,2, 0.2), col=pal, horizontal=FALSE, k=21)
> pal <- myPalette(low="red", high="green", mid="yellow")
> ColorBar(seq(-2,2, 0.2), col=pal, horizontal=FALSE, k=21)
> pal <- myPalette()
> ColorBar(seq(-2,2, 0.2), col=pal, horizontal=FALSE, k=21)
> pal <- myPalette(low="purple", high="purple",mid="white")
> ColorBar(seq(-2,2, 0.2), col=pal, horizontal=FALSE, k=21)
>
>
>
>
>
>
> dev.off()
null device
1
>