nwduplicate

Duplicate a network

Syntax

nwduplicate
[netname]
[,
name(newnetname)
replace]
   
name(newnetname) name of the new network
replace if a network named newnetname already exists, drop it and use this name anyway (see nwset for the same convention)

Description

nwduplicate simply duplicates an existing network netname. By default, the duplicated network is called netname_copy. It also duplicates the node labels of the original network.

For example:

  • . nwwebuse florentine, nwclear
  • . nwduplicate flomarriage
  • . nwname flomarriage_copy
  • . return list

Supported network types

Binary: yes. Directed: yes. Weighted: yes. Signed: yes - a full, generic copy of the network object (adjacency matrix, node labels, directed/valued/two-mode status, and mode assignments), independent of any of these properties. Two-mode: yes - the copy keeps the flag, the modes and the level labels.

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.