powered by
Checks if the supplied vector contains valid colours.
is.cols(cols)
A logical vector of length length(cols) which is TRUE for entries which are valid colours and FALSE otherwise.
length(cols)
TRUE
FALSE
A vector of colours, usually as a character string.
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