colors_from_list: Ordered colors from a list of color vectors

colors_from_listR Documentation

Ordered colors from a list of color vectors

Description

Ordered colors from a list of color vectors

Usage

colors_from_list(x, return_type = c("colors", "order"), verbose = FALSE, ...)

Arguments

x

list of character vectors that contain valid R colors.

Details

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().

Value

character vector of unique colors in x

See Also

Other jam list functions: im2list_dep(), im2list(), imSigned2list_dep(), imSigned2list(), list2concordance(), list2imSigned(), list2im()


jmw86069/multienrichjam documentation built on Feb. 7, 2024, 12:58 a.m.