| collapse_network | R Documentation |
Creates a static cograph network from the exact observed, endpoint-valid activity in a requested time range. Every collapsed edge retains all common duration summaries, so choosing one weighting does not discard the others.
collapse_network(
dn,
start = NULL,
end = NULL,
weight = c("binary", "union_duration", "total_duration", "duration_fraction",
"spell_count", "weight_sum", "weighted_duration", "latest_weight"),
sessions = c("bounded", "collapse", "separate"),
censored = c("include", "exclude")
)
dn |
A temporal network from |
start, end |
Collapse bounds. Default to the observed range. Positive
intervals are clipped to |
weight |
Edge field used as the cograph weight: |
sessions |
Session handling. |
censored |
Whether raw edge and vertex identities carrying an explicit
censor flag are |
A dynet_collapsed cograph netobject, whose two tidy tables are
reached with as.data.frame(x, what = "edges") and
as.data.frame(x, what = "nodes"). With sessions = "separate", a named
dynet_collapsed_list of such objects, one per session.
The edge table carries one row per collapsed pair and every weighting at
once, so choosing one does not discard the others: from, to,
binary (1 for a pair that was ever active), union_duration (time the
pair was active, overlaps counted once), total_duration (summed spell
lengths, overlaps counted twice), duration_fraction (union_duration
over the pair's joint activity opportunity, NA when that opportunity is
zero), spell_count, weight_sum, weighted_duration (weight times
duration, summed), latest_weight (the weight of the last spell to end),
first and last (the pair's earliest onset and latest terminus), and
the activity.duration and activity.count aliases for compatibility
with networkDynamic::network.collapse().
The node table carries one row per vertex, with name, any static vertex
attributes the network was built with, activity_duration (time the
vertex was active, overlaps counted once) and its activity.duration
alias.
dn <- dynet(data.frame(
from = c("A", "A"), to = c("B", "B"),
start = c(0, 1), end = c(2, 3)
))
flat <- collapse_network(dn, weight = "union_duration")
as.data.frame(flat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.