Description Usage Arguments Value Examples
View source: R/saviPlotFunctions.R
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.
1 | plotWithGroups(g, numOfVertexGroups)
|
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. |
A plot of the igraph with vertex groups in different colors.
1 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.