Learn R Programming

EpiModel (version 2.6.2)

as_cumulative_edgelist: Convert an Object to a Cumulative Edgelist

Description

Converts an object that carries timed-edge information into a cumulative_edgelist: a data.frame with head, tail, start, stop columns matching the format used elsewhere in EpiModel. The typical use is feeding a networkDynamic object (from a non-tergmLite simulation, an external source, or a post-hoc construction) into the reachability tools.

Usage

as_cumulative_edgelist(x)

Value

A cumulative_edgelist object: a data.frame with at least the columns head, tail, start, stop. Edges are active from time start to time stop inclusive; NA in stop means the edge was never observed to dissolve.

Arguments

x

An object to be converted to a cumulative edgelist.

Details

The networkDynamic method subtracts 1 from each spell's terminus so that the resulting start/stop range is inclusive on both ends, matching the convention used by get_cumulative_edgelist() and the reachability functions.

See Also

get_forward_reachable() / get_backward_reachable() for typical downstream uses; dedup_cumulative_edgelist() when the source contains overlapping spells for the same pair of nodes.

Other cumulative_edgelist: dedup_cumulative_edgelist(), get_cumulative_degree(), get_cumulative_edgelist(), get_cumulative_edgelists_df(), get_partners(), reachable-nodes, update_cumulative_edgelist()

Examples

Run this code
if (FALSE) {
# Convert a saved networkDynamic from a non-tergmLite netsim run
nd <- get_network(sim, sim = 1, network = 1)
el_cuml <- as_cumulative_edgelist(nd)
fwd <- get_forward_reachable(el_cuml, from_step = 1, to_step = 100)
}

Run the code above in your browser using DataLab