View source: R/A011_matrixToColours.R
matrixToColours | R Documentation |
Takes a matrix converts into rgb colours. e.g. 1=red, 2=blue, etc or ranges for each colour
matrixToColours( image, col = c("white", "black", "red", "blue", "orange", "yellow", "green", "purple", "brown", "gray"), breaks = NULL )
image |
a matrix |
col |
a list of colours or vector that can be coerced into a list using as.list. Each colour should be an rgb vector or character. Lists can contain a mixture of both formats. |
breaks |
optional. For ranges that correspond to colours |
Returns an RGB array
matrixToColours(matrix(1:9,3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.