Vector or matrix of non-negative integer or other (such as character) labels. See details.
zeroIsGrey
If TRUE, labels 0 will be assigned color grey. Otherwise, labels below 1 will trigger
an error.
colorSeq
Color sequence corresponding to labels. If not given, a standard sequence will be
used.
naColor
Color that will encode missing values.
commonColorCode
logical: if labels is a matrix, should each column have its own colors?
Details
If labels is numeric, it is used directly as index to the standard color sequence. If 0 is present
among the labels and zeroIsGrey=TRUE, labels 0 are given grey color.
If labels is not numeric, its columns are turned into factors and the numeric representation of each
factor is used to assign the corresponding colors. In this case commonColorCode governs whether each
column gets its own color code, or whether the color code will be universal.
The standard sequence start with well-distinguishable colors, and after about 40 turns into a
quasi-random sampling of all colors available in R with the exception of all shades of grey (and gray).
If the input labels have a dimension attribute, it is copied into the output, meaning the
dimensions of the returned value are the same as those of the input labels.
Value
A vector or array of character strings of the same length or dimensions as labels.