colors_from_list | R Documentation |
Ordered colors from a list of color vectors
colors_from_list(x, return_type = c("colors", "order"), verbose = FALSE, ...)
x |
list of character vectors that contain valid R colors. |
This function takes a list of colors and returns the unique
order of colors based upon the order in vectors of the list.
It is mainly intended to be called by reorderIgraphNodes()
,
however the function is useful for inferring the proper order
of unique colors from a list of various subsets of colors.
The basic assumption is that there exists one true order of unique colors, and that each vector in the list contains a subset of those colors which is consistent with this true order of colors.
The function uses only vectors that contain two or more colors, and therefore requires that all unique colors are present in the subset of vectos in the list where length >= 2. It then uses vectors with two or more colors, calculates the average observed rank for each color, then uses that average rank to define the overall color order.
If not all unique colors are present in vectors with two or
more colors, the fallback sort uses colorjam::sort_colors()
.
character vector of unique colors in x
Other jam list functions:
im2list_dep()
,
im2list()
,
imSigned2list_dep()
,
imSigned2list()
,
list2concordance()
,
list2imSigned()
,
list2im()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.