Generate colors for nodes based on community membership. Designed for
direct use with splot() node_fill parameter.
Arguments
- x
Network input: matrix, igraph, network, cograph_network, or tna object.
- method
Community detection algorithm. See
detect_communitiesfor available methods. Default"louvain".- palette
Color palette to use. Can be:
NULL(default): Uses a colorblind-friendly paletteA character vector of colors
A function that takes n and returns n colors
A palette name: "rainbow", "colorblind", "pastel", "viridis"
Any other single string is used as one color for every community.
- ...
Additional arguments passed to
detect_communities.
Value
A character vector of colors with one element per node, named by
node, for use as the node_fill argument of splot().
