Learn R Programming

brainGraph (version 1.0.0)

GraphColors: Color graph vertices and edges

Description

set_vertex_color takes an integer vector (representing membership of a community or component, etc.) and creates a character vector of colors for each community/module, component, etc. This only assigns a color to groups with at least 2 members; isolated vertices will be colored gray. set_edge_color additionally takes as input an igraph graph object. It assigns to the edges a specific color (the same as the vertex membership colors). Edges that connect vertices of two different groups are colored gray.

Usage

set_vertex_color(memb)

set_edge_color(g, memb)

Arguments

memb
An integer vector representing membership of e.g. a community
g
An igraph graph object

Value

set_vertex_color - a character vector of colors with length equal to the number of vertex groups set_edge_color - a character vector of colors with length equal to the edge count of g