View source: R/network_formats.R
| simulate_bipartite_network | R Documentation |
Simulate a bipartite network
simulate_bipartite_network(
actors,
events,
edges = NULL,
probability = 0.1,
weight = c("binary", "uniform", "normal", "poisson"),
weight_mean = 1,
weight_sd = 1,
weight_range = c(0.1, 1),
seed = NULL,
batch = NULL
)
actors |
Number or labels of primary-mode nodes. |
events |
Number or labels of secondary-mode nodes. |
edges |
Optional exact number of cross-mode edges. |
probability |
Cross-mode edge probability when |
weight |
Edge-weight distribution. |
weight_mean, weight_sd, weight_range |
Weight parameters. |
seed |
Optional seed. |
batch |
Optional single positive whole number. When given, the
simulator runs |
A tidy cross-mode edge-list simulab_sim base data.frame with one
row per actor-event edge and columns from (always an actor), to
(always an event), weight, from_mode, and to_mode. The two modes are
disjoint, so no edge joins two actors or two events and self-loops cannot
occur. as.data.frame(x, what = ) also returns nodes (node, mode),
incidence (the wide actor-by-event incidence table: an actor column
followed by one column per event), and a one-row settings table.
result <- simulate_bipartite_network(actors = 20, events = 6, probability = 0.3, seed = 1)
head(result)
components(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.