Learn R Programming

brainGraph (version 2.7.3)

GraphColors: Color graph vertices and edges

Description

set_vertex_color takes an integer vector representing membership of some grouping (e.g., a community or connected component) and creates a character vector of colors for each grouping. Isolated vertices will be colored gray.

set_edge_color assigns a color to each edge (the same as the vertex membership colors). Edges that connect vertices of two different groups are colored gray.

Usage

set_vertex_color(g, name, memb)

set_edge_color(g, name, memb)

Arguments

g

An igraph graph object

name

Character string of the name of the vertex attribute to add

memb

An integer vector representing membership of e.g. a community

Value

The same graph with additional vertex or edge attribute