View source: R/validate_tree.R
| validate_tree | R Documentation |
Checks if a transmission tree meets specific topology criteria for our test. The tree must be a directed acyclic graph (DAG), weakly connected, and have at most one infector per node.
validate_tree(tree)
tree |
A data frame with columns |
Invisible TRUE if the tree is valid. Throws an error if invalid.
good_tree <- data.frame(from = c(1, 2, 3), to = c(2, 3, 4))
validate_tree(good_tree)
bad_tree <- data.frame(from = c(1, 2, 3), to = c(2, 3, 2))
try(validate_tree(bad_tree))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.