as.data.frame.dynet_collapsed: Tidy tables from a collapsed temporal network

View source: R/collapse.R

as.data.frame.dynet_collapsedR Documentation

Tidy tables from a collapsed temporal network

Description

Tidy tables from a collapsed temporal network

Usage

## S3 method for class 'dynet_collapsed'
as.data.frame(
  x,
  row.names = NULL,
  optional = FALSE,
  what = c("edges", "nodes"),
  ...
)

Arguments

x

A network returned by collapse_network().

row.names, optional

Ignored; present for compatibility.

what

"edges", the default, or "nodes".

...

Ignored.

Value

A plain data.frame. For "edges", one row per collapsed vertex pair carrying every weighting side by side: from, to, binary, union_duration, total_duration, duration_fraction, spell_count, weight_sum, weighted_duration, latest_weight, first, last, and the activity.duration and activity.count aliases. For "nodes", one row per vertex with name, any static vertex attributes the network carries, activity_duration and its activity.duration alias. See collapse_network() for what each weighting means.

Examples

dn <- dynet(school_contacts)
collapsed <- collapse_network(dn)
as.data.frame(collapsed)
as.data.frame(collapsed, what = "nodes")

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