View source: R/network_formats.R
| simulate_edge_list | R Documentation |
Simulate a tidy network edge list
simulate_edge_list(
nodes,
edges = NULL,
probability = 0.1,
directed = TRUE,
loops = FALSE,
weight = c("binary", "uniform", "normal", "poisson"),
weight_mean = 1,
weight_sd = 1,
weight_range = c(0.1, 1),
node_type = NULL,
edge_classes = NULL,
class_probabilities = NULL,
seed = NULL,
batch = NULL
)
nodes |
Number of nodes or unique node labels. |
edges |
Optional exact number of edges. |
probability |
Edge probability when |
directed |
Generate directed edges. |
loops |
Permit self-loops. |
weight |
Edge-weight distribution. |
weight_mean, weight_sd, weight_range |
Weight parameters. |
node_type |
Optional node type for each node. |
edge_classes |
Optional number or labels of edge classes. |
class_probabilities |
Optional edge-class probabilities. |
seed |
Optional seed. |
batch |
Optional single positive whole number. When given, the
simulator runs |
A tidy simulab_sim base data.frame with one row per edge and
columns from, to, and weight (plus edge_class when edge_classes
is supplied). as.data.frame(x, what = ) also returns nodes
(node, type), adjacency (a long row/column/weight table over
all ordered node pairs), and a one-row settings table.
result <- simulate_edge_list(nodes = 40, probability = 0.08, seed = 1)
head(result)
components(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.