plotWithGroups: Plot an igraph with colored vertex groups

Description Usage Arguments Value Examples

View source: R/saviPlotFunctions.R

Description

The default plot of an igraph colors each vertex the same. Since we are trying to see the "groups" the vertices are in, we implement our own plot function. Note, that the colors are set if the number of vertices is less than or equal to 6. For larger graphs, we choose random colors from the color palette. If there are more groups than colors in r, some colors may repeat. Note if 0 is passed as the number of vertex groups, all vertices will be white.

Usage

1
plotWithGroups(g, numOfVertexGroups)

Arguments

g

The igraph to graph.

numOfVertexGroups

The desired number of vertex groups in the graph. If this number is less than 0 or not an integer, an error will be thrown.

Value

A plot of the igraph with vertex groups in different colors.

Examples

1

nsimone101/savi documentation built on July 1, 2020, 4:53 a.m.