as.networkDynamic: as.networkDynamic

View source: R/utilities.R

as.networkDynamicR Documentation

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 class 'networkDynamic'
as.networkDynamic(object,...)

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

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

Arguments

object

a network, networkLite, or networkDynamic object

...

ignored

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.

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.

Author(s)

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

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

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

networkDynamic documentation built on May 29, 2024, 1:16 a.m.