Learn R Programming

sigmaNet (version 1.1.0)

addNodeLabels: Modify the node labels of a 'sigmaNet' object.

Description

Modify the node labels of an existing 'sigmaNet' object by providing an attribute from the initial 'igraph' to use as the labels.

Usage

addNodeLabels(sigmaObj, labelAttr = NULL)

Arguments

sigmaObj

A 'sigmaNet' object - created using the 'sigmaFromIgraph' function

labelAttr

The attribute to use to create node labels

Value

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

Examples

Run this code
# NOT RUN {
library(igraph)
library(sigmaNet)
library(magrittr)

data(lesMis)

l <- layout_nicely(lesMis)
sig <- sigmaFromIgraph(graph = lesMis, layout = l) %>%
  addNodeLabels(labelAttr = 'label')
sig

# }

Run the code above in your browser using DataLab