View source: R/build_toy_net.R
build_toy_net | R Documentation |
Generate a binary tripartite network with three groups of nodes (a-, b- and c-nodes) and two subnetworks (P and Q). Subnetwork P contains links between a- and b-nodes; Subnetwork Q contains links between b- and c-nodes;b-nodes (some of which are connector nodes) are shared nodes between two subnetworks.
build_toy_net(N_a, N_b, N_c, Co, output_matrices = FALSE)
N_a |
The number of nodes in the a-node group. |
N_b |
The number of nodes in the b-node group. |
N_c |
The number of nodes in the c-node group. |
Co |
The probability of creating a link between any two nodes. It ranges from 0 to 1. |
output_matrices |
Logical. Whether to output the entire adjacency matrix of the network and subnetworks. Defaults to FALSE. |
Return a random binary tripartite network.
Pilosof, S., Porter, M., Pascual, M. et al. The multilayer nature of ecological networks. Nat Ecol Evol 1, 0101 (2017). https://doi.org/10.1038/s41559-017-0101
set.seed(12)
Net <- build_toy_net(11,15,16,0.2)
plot(Net)
set.seed(12)
Net <- build_toy_net(11,15,16,0.2,output_matrices=TRUE)
Net
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.