nwrestore

Restore network data previously preserved

Syntax

nwrestore

Description

nwrestore restores network data (including all normal Stata variables) previously saved by nwpreserve - the network-aware counterpart of Stata’s own preserve/ restore pair. If nothing was preserved (or it was already restored once), nwrestore reports “Nothing to restore” and does nothing further.

The temporary file nwrestore reads from is deleted once restored, so a given nwpreserve call can only be restored once - exactly like Stata’s own preserve/restore.

Examples

Preserve a network, drop it, then restore it:

. nwclear
. nwrandom 5, prob(.4) name(mynet)
. nwpreserve
. nwdrop mynet
. nwset
. nwrestore
. nwset

Supported network types

Binary: yes. Directed: yes. Weighted: yes. Signed: yes. Two-mode: yes - restores the full working state saved by nwpreserve, independent of any of these properties.


Back to top

nwcommands is free to install and use, including for commercial research. See the GitHub repository for source, license, and issue tracking.

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