Find a vector of distinct R built-in colors for a pre-defined length ('nrcol').
distinctcolors(
nrcol = 10,
method = "RGB",
bw = FALSE,
show = TRUE,
simulate = TRUE
)a non-negative integer specifying the number of colors to be used (defaults to the length of 10, if not specified).
character string implying the method for color selection to be used ("RGB" uses a grid in the RGB space (default), "Lab" uses a grid in the Lab space, "goldenratio" uses the golden ratio as spacing between colors in the HSV color space).
logical: if TRUE (FALSE by default), the colors "black" and "white" are removed from the resulting colorpalette.
logical: if TRUE (by default), the resulting colorpalettes are depicted in an R plot.
logical: if TRUE (by default), a converted colorpalettes are additionally depicted to simulate dichromat vision according to http://www.daltonize.org (see daltonize).
distinctcolors returns a vector containing R built-in colors in hexadecimal representation.
# NOT RUN {
distinctcolors()
# }
Run the code above in your browser using DataLab