Modify the edge colors of a 'sigmaNet' object by providing either: (1) a single color to use for every edge; or (2) an attribute of the initial 'igraph' object that will be used to determine color.
addEdgeColors(sigmaObj, oneColor = NULL, colorAttr = NULL, colorPal = "Set2")
sigmaObj | A 'sigmaNet' object - created using the 'sigmaFromIgraph' function |
---|---|
oneColor | A single color to color all of the nodes (hex format) |
colorAttr | An attribute from the original 'igraph' nodes to color the nodes by |
colorPal | The color palatte to use - only used if colorAttr is specified |
A 'sigmaNet' object with modified node labels. This object can be called directly to create a visualization, or modified by additional functions.
If the 2nd option is used, you can also specify a color palette from 'RColorBrewer.'
library(igraph) library(sigmaNet) library(magrittr) data(lesMis) l <- layout_nicely(lesMis) #one color for all edges sig <- sigmaFromIgraph(graph = lesMis, layout = l) %>% addEdgeColors(oneColor = '#D95F02') sig