rename_nodes: Rename nodes everywhere in a temporal network

View source: R/edit.R

rename_nodesR Documentation

Rename nodes everywhere in a temporal network

Description

Rename nodes everywhere in a temporal network

Usage

rename_nodes(dn, mapping)

Arguments

dn

A temporal network.

mapping

A named character vector whose names are old node names and values are replacements, a two-column data frame named old and new, or the name of one vertex attribute (given through dynet(nodes = )) whose values become the node names. The attribute must be complete and unique.

Value

A new dynet object, class c("dynet", "netobject", "cograph_network"), with edge endpoints, node attributes, vertex activity, cograph labels, and groups renamed together. Raises dynet_unknown_node when an old name is not a vertex, dynet_duplicate_node when a replacement collides with a name that is being kept, dynet_unknown_attribute when mapping names a column that is not a vertex attribute, and dynet_bad_input otherwise.

Examples

dn <- dynet(school_contacts)
renamed <- rename_nodes(dn, c(Ana = "Anna", Ben = "Benjamin"))
renamed

Dynet documentation built on Oct. 7, 2026, 5:08 p.m.