Learn R Programming

networkDynamic (version 0.11.4)

as.networkDynamic: as.networkDynamic

Description

The as.networkDynamic generic provides a very basic conversion to networkDynamic from other network types. It is generally recommended to use the networkDynamic function instead of as.networkDynamic, because networkDynamic provides a number of additional features for handling temporal information.

Usage

# S3 method for networkDynamic
as.networkDynamic(object,...)

# S3 method for network as.networkDynamic(object,...)

# S3 method for networkLite as.networkDynamic(object,...)

Value

For as.networkDynamic.network the input object is returned with a

networkDynamic class added. For as.networkDynamic.networkLite, the input object is converted to a network object and then the

networkDynamic class is added. For

as.networkDynamic.networkDynamic the input object is returned unchanged.

Arguments

object

a network, networkLite, or networkDynamic object

...

ignored

Author

Pavel, Zack W Almquist <almquist@uci.edu>

Details

as.networkDynamic.network converts a network object into a networkDynamic object by adding a networkDynamic class.

as.networkDynamic.networkLite converts a networkLite object into a networkDynamic object by first converting it to a network object and then adding a networkDynamic class. (networkLites are a backend data structure used in some EpiModel and statnet packages, providing improved performance for certain applications, especially when working with vertex and edge attributes that can be stored as atomic vectors. Currently, networkLites come with the restriction that the network attributes hyper, multiple, and loops must be FALSE. See networkLite-package for more information.)

Such conversions between network types are used when starting a dynamic simulation from a cross-sectional network and returning the simulation history as a dynamic network, as done in the tergm package for example.

See Also

For the inverse (removing the networkDynamic class) see as.network.networkDynamic and as.networkLite.network (which applies to networkDynamics). For extracting cross-sectional information from a networkDynamic (which is often more appropriate than simply removing the networkDynamic class), see network.collapse and network.extract. For more general construction of networkDynamics, see networkDynamic.

Examples

Run this code
 nd <- as.networkDynamic(network.initialize(3))
 class(nd)
 is.networkDynamic(nd)
 
 nwL <- networkLite::networkLite(3)
 nwD <- as.networkDynamic(nwL)
 class(nwD)
 is.networkDynamic(nwD)

Run the code above in your browser using DataLab