rainbowJamMulti | R Documentation |
Rainbow categorical colors across multiple groups
rainbowJamMulti(ns, do_plot = FALSE, ...)
ns |
|
do_plot |
|
... |
additional arguments are passed to |
This function applies colorjam::rainbowJam()
to multiple
vectors, such that the categorical colors are not duplicated,
and are assigned as well-spaced across the rainbow for
each group as possible.
list
of categorical colors, length equal to the
input length(ns)
, with color vectors with lengths ns
.
Other colorjam assignment:
col_div_xf()
,
col_linear_xf()
,
group2colors()
,
matrix2heatColors()
,
vals2colorLevels()
,
vibrant_color_by_hue()
opar <- par("mfrow"=c(3, 1));
on.exit(par(opar));
ns <- c(A=8, B=3, C=4);
colorlist1 <- rainbowJamMulti(ns,
do_plot=TRUE,
main="rainbowJamMulti()");
# basic assignment in order
colorset2 <- colorjam::rainbowJam(sum(ns));
colorlist2 <- split(colorset2, rep(seq_along(ns), ns))
jamba::showColors(colorlist2, main="sequential assignment")
# re-assign the same colors
colorlist3 <- lapply(ns, colorjam::rainbowJam);
jamba::showColors(colorlist3, main="independent color assignment");
par(opar);
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.