nwnode

Check whether a node exists in a network

Syntax

nwnode
[netname],
[ego(nodename)
egoid(nodeid)]
   
ego(nodename) Look up the node by name
egoid(nodeid) Look up the node by id

Description

The command checks if node nodename exists in network netname and returns its nodeid. In case it does not exist, it returns -1. Either ego() or egoid() needs to be specified; if both are given, egoid() takes precedence and ego() is silently ignored.

Examples

. nwwebuse florentine
. nwnode flobusiness, ego(medici)

Supported network types

Binary: yes. Directed: yes. Weighted: yes. Signed: yes. Two-mode: yes - a pure node-existence/lookup check; does not read tie values or depend on directed/valued/two-mode status.

See also

  • nwvalue
  • last certified : 24 Aug 2026

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.