add_node_labels: Modify the node labels of a sgraph object.

View source: R/sigma_attrs.R

add_node_labelsR 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


sgraph documentation built on Sept. 12, 2024, 7:06 a.m.