Learn R Programming

sgraph (version 1.1.0)

add_node_labels: Modify the node labels of a sgraph object.

Description

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

Usage

add_node_labels(sigma_obj, label_attr = NULL)

Value

sgraph object with modified node labels

Arguments

sigma_obj

sgraph object, returned by sigma_from_igraph function

label_attr

Attribute to use to replace node labels

Examples

Run this code
library(igraph)
library(sgraph)

data(lesMis)

sig <- sigma_from_igraph(igraph = lesMis) %>%
  add_node_labels(label_attr = 'label')
sig

Run the code above in your browser using DataLab