| as.data.frame.dynet | R Documentation |
Tidy tables from a temporal network
## S3 method for class 'dynet'
as.data.frame(
x,
row.names = NULL,
optional = FALSE,
what = c("edges", "nodes", "bins", "network", "observations", "observed_edges",
"vertex_spells"),
measure = NULL,
sessions = c("bounded", "collapse", "separate"),
start = NULL,
end = NULL,
...
)
x |
A temporal network from |
row.names |
Ignored; present for compatibility with the generic. |
optional |
Ignored; present for compatibility with the generic. |
what |
Which table to return: |
measure |
Optional centrality measures to annotate the vertex table
with, valid only for |
sessions |
How sessions are treated while |
start, end |
Measurement bounds passed to |
... |
Ignored. |
A plain data.frame, one row per whatever what names.
"edges": one row per unchanged raw spell, with from, to, start,
end, duration and weight. A session column is present when the
network was built with sessions, onset_censored and terminus_censored
when interval censoring was declared explicitly, and any column the
construction carried through – thread for a threaded log, group for
a co-presence log.
"observations": one row per canonical observation component, with
observation, start, end, duration and instant.
"observed_edges": one row per derived observation fragment, with
raw_spell, observation and fragment locating it, from, to,
start, end (clipped to the observation), raw_start, raw_end (as
supplied), weight, instant, the strict
left_observation_censored and right_observation_censored flags, and
duration.
session and the explicit onset_censored/terminus_censored flags are
copied unchanged from the raw spell when the network carries them.
"vertex_spells": one row per maximal declared activity component, with
vertex_spell, node, start, end, duration, instant, session,
onset_censored and terminus_censored. Half-open positive spells and
exact points are both representable. Undeclared vertices are implicitly
always active and receive no synthetic rows, so this table is empty for a
network with no declared vertex activity.
"nodes": one row per vertex, with name, any static attributes
supplied at construction, and one column per measure named in measure.
"bins": one row per measurement window, with bin, lo, hi, time
(the bin's representative time) and closed (whether the upper bound is
included). Bins are component-qualified under discontinuous observation.
"network": one row per aggregate vertex pair, with from, to and the
summed weight cograph renders.
dn <- dynet(school_contacts)
spells <- as.data.frame(dn)
head(spells)
as.data.frame(dn, what = "nodes")
as.data.frame(dn, what = "vertex_spells")
# Annotate the vertex table so it can be filtered without a second call.
busy <- as.data.frame(dn, what = "nodes",
measure = c("degree", "indegree", "outdegree"))
subset(busy, degree > 15)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.