This help topic is for R version 2.9.0. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/grDevices/html/gray.html
gray {grDevices}R Documentation

Gray Level Specification

Description

Create a vector of colors from a vector of gray levels.

Usage

gray(level)
grey(level)

Arguments

level

a vector of desired gray levels between 0 and 1; zero indicates "black" and one indicates "white".

Details

The values returned by gray can be used with a col= specification in graphics functions or in par.

grey is an alias for gray.

Value

A vector of colors of the same length as level.

See Also

rainbow, hsv, hcl, rgb.

Examples

gray(0:8 / 8)

[Package grDevices version 2.9.0 ]