add_vertex_spells: Add declared vertex-activity spells

View source: R/support-edit.R

add_vertex_spellsR Documentation

Add declared vertex-activity spells

Description

Add declared vertex-activity spells

Usage

add_vertex_spells(dn, data)

Arguments

dn

A temporal network.

data

A nonempty vertex-spell data frame with node, start, and end, plus optional session, onset_censored, and terminus_censored. Unlike set_vertex_spells() this argument is required; NULL is an error.

Value

A new dynet object, class c("dynet", "netobject", "cograph_network"), with the network's existing activity and data canonicalised together, so an added spell that overlaps or abuts an existing one for the same vertex is merged into it and canonical spell identifiers may change. Raises dynet_unknown_node for a vertex the network does not have, and dynet_bad_input when data is not a nonempty data frame, and dynet_incompatible_vertex_spells when session is supplied to a network with no session scheme – the same refusal update_vertex_spells() makes, rather than dropping the label.

Examples

dn <- dynet(school_contacts)
present <- data.frame(node = c("Ana", "Ben"), start = 0, end = 10)
enrolled <- set_vertex_spells(dn, present)
extended <- add_vertex_spells(enrolled,
                              data.frame(node = "Cara", start = 5, end = 20))
as.data.frame(extended, what = "vertex_spells")

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