Learn R Programming

IMIFA (version 2.2.0)

is.cols: Check for Valid Colours

Description

Checks if the supplied vector contains valid colours.

Usage

is.cols(cols)

Value

A logical vector of length length(cols) which is TRUE for entries which are valid colours and FALSE otherwise.

Arguments

cols

A vector of colours, usually as a character string.

Examples

Run this code
all(is.cols(1:5))

all(is.cols(heat.colors(30)))

any(!is.cols(c("red", "green", "aquamarine")))

Run the code above in your browser using DataLab