set.seed(40)
The trees in 'newick' format produced by scrm's -T
option are compatible
with the read.tree
function from package 'ape'. This quick example shows how
we can exploid this to visualize the Ancestral Recombination Graph (ARG)
simulated with scrm.
First, we call scrm to simulate the ARG:
library(scrm) sum_stats <- scrm('5 1 -r 1.5 100 -T') sum_stats$trees[[1]]
Now we can convert the trees into ape's internal format using read.tree
:
library(ape) trees <- read.tree(text = paste0(sum_stats$trees[[1]])) trees
And -- for example -- print the trees:
plot(trees, no.margin = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.