update_vertex_spells: Update declared vertex-activity components

View source: R/support-edit.R

update_vertex_spellsR Documentation

Update declared vertex-activity components

Description

Update declared vertex-activity components

Usage

update_vertex_spells(dn, spells, data)

Arguments

dn

A temporal network.

spells

Integer positions or a logical mask over canonical vertex activity, as returned by as.data.frame(dn, what = "vertex_spells").

data

A data frame with one row, or one row per selected component, containing the fields to replace: node, start, end, session, onset_censored or terminus_censored. Any other column name raises dynet_unknown_column, so a misspelled field is refused rather than quietly doing nothing.

Value

A new dynet object, class c("dynet", "netobject", "cograph_network"). Updated components are canonicalised with the retained components, so overlaps can merge and spell identifiers can change. Raises dynet_bad_input when spells is not a valid selection, when data is malformed or of the wrong height, or when it names the read-only derived columns vertex_spell, duration or instant.

Examples

dn <- dynet(school_contacts)
present <- data.frame(node = c("Ana", "Ben"), start = 0, end = 10)
enrolled <- set_vertex_spells(dn, present)
extended <- update_vertex_spells(enrolled, spells = 1,
                                 data = data.frame(end = 12))
as.data.frame(extended, what = "vertex_spells")

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