Last data update: 2014.03.03

R: Create a list of colors from among a variety of color...
chooseColorsR Documentation

Create a list of colors from among a variety of color palettes.

Description

Create a list of colors from among a variety of color palettes.

Usage

chooseColors(pal = paletteChoices(), num, ...)

paletteChoices()

Arguments

pal

A character that is the name of a palette. Must be one of “rich”, “cm”, “default”, “grey”, “gray”, “heat”, “jet”, “rainbow”, “topo”, or “terrain”, which are given in paletteChoices.

num

The number of colors to be returned.

...

Other arguments to the various palette functions.

Value

A vector of colors of length num.

Author(s)

Derek H. Ogle, derek@derekogle.com

See Also

See rich.colors in gplots, cm.colors, heat.colors, topo.colors, terrain.colors, rainbow, colorRampPalette, and colors.

Examples

n <- 20
# Color Wheels
pie(rep(1,n), col=chooseColors("rich",n))
pie(rep(1,n), col=chooseColors("rainbow",n))
pie(rep(1,n), col=chooseColors("topo",n))
pie(rep(1,n), col=chooseColors("gray",n))
pie(rep(1,n), col=chooseColors("jet",n))

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(FSA)


 ############################################
 ##      FSA package, version 0.8.7        ##
 ##    Derek H. Ogle, Northland College    ##
 ##                                        ##
 ## Run ?FSA for documentation.            ##
 ## Run citation('FSA') for citation ...   ##
 ##   please cite if used in publication.  ##
 ##                                        ##
 ## See derekogle.com/fishR/ for more      ##
 ##   thorough analytical vignettes.       ##
 ############################################


> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/FSA/chooseColors.Rd_%03d_medium.png", width=480, height=480)
> ### Name: chooseColors
> ### Title: Create a list of colors from among a variety of color palettes.
> ### Aliases: chooseColors paletteChoices
> ### Keywords: manip
> 
> ### ** Examples
> 
> n <- 20
> # Color Wheels
> pie(rep(1,n), col=chooseColors("rich",n))
> pie(rep(1,n), col=chooseColors("rainbow",n))
> pie(rep(1,n), col=chooseColors("topo",n))
> pie(rep(1,n), col=chooseColors("gray",n))
> pie(rep(1,n), col=chooseColors("jet",n))
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>