Modify the edge size of a 'sigmaNet' object by providing one of the following: (1) a single size to use for all edges; or (2) an attribute in the initial igraph to be used to size the edges.
addEdgeSize(sigmaObj, sizeAttr = NULL, minSize = 1, maxSize = 5, oneSize = NULL)
sigmaObj | A 'sigmaNet' object - created using the 'sigmaFromIgraph' function |
---|---|
sizeAttr | The attribute to use to create edge size (width) |
minSize | The minimum size of the edges (for scaling) |
maxSize | The maximum size of the edges (for scaling) |
oneSize | A single size to use for all edges |
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 method is used, the minSize and maxSize attribute will control lower and upper bounds of the scaling function.
library(igraph) library(sigmaNet) library(magrittr) data(lesMis) l <- layout_nicely(lesMis) #specify a single edge size sig <- sigmaFromIgraph(graph = lesMis, layout = l) %>% addEdgeSize(oneSize = 5) sig #specify an attribute and min/max sig <- sigmaFromIgraph(graph = lesMis, layout = l) %>% addEdgeSize(sizeAttr = 'value', minSize = .1, maxSize = 2) sig