set_tie_sessions: Assign or remove tie sessions

View source: R/support-edit.R

set_tie_sessionsR Documentation

Assign or remove tie sessions

Description

Assign or remove tie sessions

Usage

set_tie_sessions(dn, session = NULL, breaks = NULL, labels = NULL)

Arguments

dn

A temporal network.

session

A complete, nonempty character vector of length one or the raw tie count; a length-one value labels every spell. Default NULL, which, when breaks is also NULL, removes all tie-session walls and erases session labels on vertex activity.

A vector of the full length is matched positionally against the spell table, not against the data frame the network was built from. dynet() sorts spells by start, end, from and to, so the two orders coincide only when the input was already in that order. To cut sessions by time, use breaks instead.

breaks

Optional increasing numeric vector of cut points on the network's time axis. A spell belongs to the session of the interval its start falls in: before the first break, between two breaks, or from the last break on, so k breaks give k + 1 sessions. Mutually exclusive with session.

labels

Optional character vector naming the k + 1 sessions that breaks defines, in time order. The default is session_1, session_2 and so on.

Value

A new dynet object, class c("dynet", "netobject", "cograph_network"), with a session column on the spell table and the session scheme recorded in its metadata, or with both removed when neither session nor breaks is given. Raises dynet_bad_input when session has neither length one nor the raw tie count, or carries NA or blank labels; when session and breaks are both given; when breaks is not increasing and finite; or when labels does not have one more element than breaks.

Examples

dn <- dynet(school_contacts)
weeks <- set_tie_sessions(dn, breaks = c(7, 14),
                          labels = c("week_1", "week_2", "week_3"))
weeks

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