Learn R Programming

sigmaNet (version 1.1.0)

addEdgeSize: Modify the edge size of a 'sigmaNet' object.

Description

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.

Usage

addEdgeSize(sigmaObj, sizeAttr = NULL, minSize = 1, maxSize = 5,
  oneSize = NULL)

Arguments

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

Value

A 'sigmaNet' object with modified node labels. This object can be called directly to create a visualization, or modified by additional functions.

Details

If the 2nd method is used, the minSize and maxSize attribute will control lower and upper bounds of the scaling function.

Examples

Run this code
# NOT RUN {
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

# }

Run the code above in your browser using DataLab