powered by
Check an object to see if it is a valid colour or set of colours.
is_colour(x)# S3 method for character is_colour(x)# S3 method for numeric is_colour(x)# S3 method for logical is_colour(x)# S3 method for factor is_colour(x)
# S3 method for character is_colour(x)
# S3 method for numeric is_colour(x)
# S3 method for logical is_colour(x)
# S3 method for factor is_colour(x)
object to be tested.
Colours in R can be represented by names (colours), index number (palette) or a hexidecimal character.
colours
palette
# NOT RUN { is_colour('#ffffff') is_colour('white') is_colour('periwinkle blue') is_colour(4L) # }
Run the code above in your browser using DataLab