nwcurrent

Report and set current network

Syntax

nwcurrent 
[netname]
[,
id(int)]
   
id(int) Originl network ID of the the network that should be made the current network

Description

Almost all nwcommands allow that a netname or netlist is optional. When no network is specified in such a case, by default, the nwcommands apply the command to the current network.

The current network is simply the last network that has been set, imported or generated. This is a convenient way to way access the latest network one worked with.

nwcurrent changes the current network. Typically, it can be used with a netname. When used with id(), the network ID refers to the original order the networks were generated in. The command also returns some information about the current network in the r() vector.

Examples

. nwwebuse florentine
. nwcurrent
----------------------------------------
   Current network:  flomarriage
   Number of nodes:  16
----------------------------------------

. nwcurrent flobusiness
----------------------------------------
   Current network:  flobusiness
   Number of nodes:  16
----------------------------------------

Supported network types

Not applicable - reports or sets which network is the “current” one; does not read or depend on any network’s own content, directed/valued/two-mode status, or tie values.

Stored results

Scalars:
  r(networks)	number of networks

Macros:
  r(current)	name of current network

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.