add_node_labels {sgraph}R Documentation

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)

Arguments

sigma_obj

sgraph object, returned by sigma_from_igraph function

label_attr

Attribute to use to replace node labels

Value

sgraph object with modified node labels

Examples

library(igraph)
library(sgraph)

data(lesMis)

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


[Package sgraph version 1.0.0 Index]