| mixing | R Documentation |
How much each kind of vertex interacted with each other kind, in every time bin. This is the question a temporal network answers that a static one cannot: not whether high and low achievers mixed, but when they did, and whether the pattern held or decayed.
The grouping variable comes from the vertex attributes supplied to
dynet() through its nodes argument.
mixing(
dn,
attribute,
sessions = c("bounded", "collapse", "separate"),
sample = NULL,
start = NULL,
end = NULL,
step = NULL,
window = NULL,
plot = FALSE
)
dn |
A temporal network from |
attribute |
Name of a column in the vertex table. A name the network
does not carry raises an error of class |
sessions |
How to treat sessions, as in |
sample |
Deprecated. |
start, end |
First and last time at which to measure. Default to the observed range. A network built from dates may be addressed with dates. |
step |
How often to measure. Defaults to the interval the network was built with. |
window |
How much time each measurement covers. Defaults to |
plot |
Whether to draw the result as well as return it. Drawing is a
side effect in the manner of |
Each cell is a raw count of distinct active binary vertex dyads. Repeated, overlapping, or split spells and edge weights do not multiply a dyad. Retained self-loops count once. For directed networks, every ordered group pair is reported and
M_{ab}=\sum_{u:g(u)=a}\sum_{v:g(v)=b}Y_{uv}.
The row and column margins are grouped outdegree and indegree, and the table sum is the active directed edge count including retained loops.
Undirected networks report one lexicographically canonical cell for each
unordered group pair, with display labels such as "A -- B". A within-group
edge or loop contributes once to its diagonal cell. The group stub margin is
d_a=2M_{aa}+\sum_{b\ne a}M_{\min(a,b),\max(a,b)},
so the margins sum to twice the table total. These are unnormalised counts, not Newman's mixing proportions.
Missing attribute values are retained as a collision-safe explicit group ordered after observed labels. Bounded and collapsed modes both use the binary calendar union: a dyad active in two sessions at the same time counts once. Separate mode returns session-local tables over the fixed group universe. Every supported cell is emitted, including zeros. Declared vertex activity first induces the endpoint-valid snapshot. The complete group-cell universe remains fixed, but inactive vertices and eligible isolates contribute no dyad.
A dynet_metric at graph level with one row per time point and
group pair. The columns are session (only under
sessions = "separate", the one mode that keeps session labels apart),
time, measure, value, from_group and to_group. Directed
measure labels use "A -> B"; undirected labels use "A -- B".
value is the active binary-dyad count, and the authoritative
from_group and to_group columns identify the cell. Attributes record
unit, pair-domain, normalisation, weight, loop, missing-group, and
session-aggregation conventions.
Errors: dynet_unknown_attribute (no such vertex attribute),
dynet_no_sessions (sessions = "separate" without a session column),
dynet_outside_observation (the requested range misses observed support;
it also carries dynet_bad_input),
and dynet_bad_input for every other broken contract – dn not a
dynet, an attribute that is not a single column name, and an
out-of-range start, end, step or window.
Warning: dynet_deprecated for the retired sample argument.
Newman, M. E. J. (2003). Mixing patterns in networks. Physical Review E, 67, 026126. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1103/PhysRevE.67.026126")}
Morris, M., Handcock, M. S., & Hunter, D. R. (2008). Specification of exponential-family random graph models: terms and computational aspects. Journal of Statistical Software, 24(4). \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v024.i04")}
dn <- dynet(forum_posts, thread = "thread", nodes = forum_people)
role_mixing <- mixing(dn, attribute = "role")
role_mixing
plot(role_mixing)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.