addEdgeColors: Modify the edge colors of a 'sigmaNet' object.

Description Usage Arguments Details Value Examples

View source: R/sigmaAttrs.R

Description

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.

Usage

1
2
addEdgeColors(sigmaObj, oneColor = NULL, colorAttr = NULL,
  colorPal = "Set2")

Arguments

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

Details

If the 2nd option is used, you can also specify a color palette from 'RColorBrewer.'

Value

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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

sigmaNet documentation built on May 2, 2019, 11:06 a.m.