The same operation as add_ties(), with one extra guarantee: the network
must already be directed, so from and to keep the direction the caller
means. Adding an arc to an undirected network raises a condition of class
dynet_needs_directed rather than silently recording a symmetric tie.
Arguments
- dn
A temporal network from
dynet().- data
A nonempty data frame with
from,to,start, andend. Optional columns areweight,session,onset_censored, andterminus_censored. Endpoints must already exist indn.- loops
Whether added self-loops are permitted.
FALSE, the default, raises a condition of classdynet_loop_not_allowed.
See also
add_ties(), which does not require a directed network.
Examples
dn <- dynet(data.frame(from = "A", to = "B", start = 0, end = 1))
dn <- add_nodes(dn, "C")
add_arcs(dn, data.frame(from = "B", to = "C", start = 1, end = 2))
#> # Temporal network (interval format, directed) | a cograph netobject
#> # 3 vertices | 2 edge spells | 2 distinct pairs
#> # observed from 0 to 2 step, binned every 1
#>
#> from to start end duration weight
#> A B 0 1 1 1
#> B C 1 2 1 1