is_color | R Documentation |
This function checks if each element in a character vector represents a valid color. It performs two checks:
It tests whether each element in the vector matches the pattern of a valid hexadecimal color code (e.g., "#RRGGBB").
It tests whether each element in the vector is one of the recognized color names in R.
is_color(vector)
vector |
A character vector containing color names or hexadecimal color codes. |
A logical vector of the same length as 'vector', where each element is 'TRUE' if the corresponding element in 'vector' represents a valid color, and 'FALSE' otherwise.
is_color(c("#FF0000", "blue", "invalid", "green"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.