nwnoderename

Rename a single node in a network

Syntax

nwnoderename 
[netname]
,
old(old_nwnode)
new(new_nwnode)

Description

nwnoderename changes the name of a single node in a network. When a node with name old_nwnode is found in netname, it is replaced with new_nwnode.

Examples

. nwclear
. nwrandom 4, prob(1) name(mynet)
. list _nwnode _nwinclude

   +--------------------+
   | _nwnode   _nwinc~e |
   |--------------------|
1. |      n1          1 |
2. |      n2          1 |
3. |      n3          1 |
4. |      n4          1 |
   +--------------------+

. nwnoderename mynet, old(n1) new(x1)
. list _nwnode _nwinclude

   +--------------------+
   | _nwnode   _nwinc~e |
   |--------------------|
1. |      x1          1 |
2. |      n2          1 |
3. |      n3          1 |
4. |      n4          1 |
5. |      n1          0 |
   +--------------------+

Supported network types

Binary: yes. Directed: yes. Weighted: yes. Signed: yes - renames a single node’s own label only; ties, tie values, and mode assignment are completely unchanged.

See also


nwcommands version 3.17.6, 9 November 2026 (check your installed version)


Back to top

nwcommands is free software under the GNU General Public License, version 3, as are the model packages nwsaom, nwergm, nwdynam and nwrem. Citing and licenses · Get help · GitHub. Issues with the core go to the nwcommands repository; issues with a model package go to that package's own repository.

This site uses Just the Docs, a documentation theme for Jekyll.