projection: Project a temporal network into directed vertex-time states

View source: R/projection.R

projectionR Documentation

Project a temporal network into directed vertex-time states

Description

projection() discretises a temporal network into snapshot slices and connects each vertex state to its realisation in the next slice. Within a slice it uses the same independently aggregated, endpoint-induced snapshot as snapshots(). Identity arcs always point forward and carry the coupling weight omega. The result is a tidy projection object rather than a bare matrix.

Usage

projection(
  dn,
  sessions = c("bounded", "collapse", "separate"),
  start = NULL,
  end = NULL,
  step = NULL,
  window = NULL,
  omega = 1
)

Arguments

dn

A temporal network from dynet().

sessions

Session handling: "bounded" (the default), "collapse" or "separate". "collapse" erases labels. For a sessioned network, "bounded" and "separate" both preserve disjoint session-local projection blocks so identity arcs never cross a wall.

start, end

First and last slice times. Defaults to observed support.

step

Spacing between slice starts. NULL uses the construction interval.

window

Width represented by each slice. NULL uses step; zero samples an exact point; "all" represents the whole observed period as a single slice, closed on the right.

omega

Weight on the identity arcs that carry a vertex from one slice to the next, that is, the interlayer coupling of the time-expanded network. One, the default, keeps an identity arc as heavy as a unit contact; zero leaves the slices uncoupled. Must be a single finite non-negative number, or a dynet_bad_input error is raised.

Details

Every fixed-universe vertex receives one state in every emitted slice. active records whether the vertex was eligible in that slice. Identity arcs are retained through inactive slices because Dynet permits waiting through vertex inactivity; inactive states have no incident endpoint-induced within-slice edge. Consecutive observed slices are also linked across an observation gap, matching Dynet's calendar-time waiting convention.

Directed source edges produce one within-slice arc. An undirected nonloop edge produces reciprocal arcs, while an undirected loop is emitted once. Parallel active spells are one within-slice pair whose weight is their summed weight and whose n_spells records their count. Identity arcs have weight = omega and n_spells = 0, and meta$identity_weight reports the same value.

Value

An object of class dynet_projection. Use as.data.frame(x, what = "vertices") for vertex states and as.data.frame(x, what = "edges") for directed projected arcs.

References

Bender-deMoll, S., & Moody, J. timeProjectedNetwork() in the tsna package, version 0.3.6.

Butts, C. T., Leslie-Cook, A., Krivitsky, P. N., & Bender-deMoll, S. (2024). networkDynamic: Dynamic Extensions for Network Objects, version 0.11.5. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.32614/CRAN.package.networkDynamic")}

Examples

dn <- dynet(data.frame(
  from = c("A", "B", "C"), to = c("B", "C", "A"),
  start = 0:2, end = 1:3
), observation_start = 0, observation_end = 3)
projected <- projection(dn, step = 1, window = 1)
as.data.frame(projected, what = "vertices")
as.data.frame(projected, what = "edges")


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