add_arcs: Add directed temporal arcs

View source: R/ties.R

add_arcsR Documentation

Add directed temporal arcs

Description

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.

Usage

add_arcs(dn, data, loops = FALSE)

Arguments

dn

A temporal network from dynet().

data

A nonempty data frame with from, to, start, and end. Optional columns are weight, session, onset_censored, and terminus_censored. Endpoints must already exist in dn.

loops

Whether added self-loops are permitted. FALSE, the default, raises a condition of class dynet_loop_not_allowed.

Value

A new directed dynet object carrying the added spells, with the same structure as the input.

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))

Dynet documentation built on Oct. 7, 2026, 5:08 p.m.