View source: R/plot-distributions.R
| plot_network_evolution | R Documentation |
Displays a network at different time points side by side. Accepts an edge list data frame with a time column, or a pre-built list of networks. All panels share the same node layout for visual comparison.
plot_network_evolution(
x,
time = NULL,
slices = NULL,
cumulative = FALSE,
labels = NULL,
layout = "spring",
ncol = NULL,
node_size = 5,
seed = 42,
combined = TRUE,
...
)
x |
An edge list data frame with columns |
time |
Character. Name of the time/group column in |
slices |
Integer or NULL. Number of equal-width time bins. Default NULL uses unique values of the time column. |
cumulative |
Logical. If TRUE, each panel shows all edges up to that time point (growing network). If FALSE (default), each panel shows only edges from that period. |
labels |
Character vector of panel labels. Default NULL (auto from time values). |
layout |
Layout specification. Default |
ncol |
Integer. Grid columns. Default auto. |
node_size |
Numeric. Default 5. |
seed |
Integer or NULL. Default 42. |
combined |
Logical: when TRUE (default), arrange period panels in an
internal grid via |
... |
Additional arguments passed to |
Invisible list of per-panel networks or edge-list data frames.
set.seed(1)
edges <- data.frame(
from = sample(LETTERS[1:5], 30, replace = TRUE),
to = sample(LETTERS[1:5], 30, replace = TRUE),
week = sample(1:4, 30, replace = TRUE))
cograph::plot_network_evolution(edges, time = "week")
cograph::plot_network_evolution(edges, time = "week", cumulative = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.