make_tree | R Documentation |
Creates a transmission tree with a specified number of cases and branches per case. The tree can be generated with fixed or Poisson-distributed branching factors.
make_tree(n_cases, R = 2, stochastic = FALSE, plot = FALSE)
n_cases |
Integer. The total number of cases (nodes) in the tree. |
R |
Integer. The fixed number of branches per case when |
stochastic |
Logical. If |
plot |
Logical. If |
An igraph object representing the transmission tree.
# Generate a deterministic transmission tree
deterministic_tree <- make_tree(n_cases = 15, R = 2, stochastic = FALSE, plot = TRUE)
# Generate a stochastic transmission tree
random_tree <- make_tree(n_cases = 15, R = 2, stochastic = TRUE, plot = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.