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.
# S3 method for networkDynamic
as.networkDynamic(object,...)# S3 method for network
as.networkDynamic(object,...)
# S3 method for networkLite
as.networkDynamic(object,...)
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.
a network, networkLite, or networkDynamic object
ignored
Pavel, Zack W Almquist <almquist@uci.edu>
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.
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.
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