This vignette shows how to parse a BEAST2 posterior file using rBEAST.

Load the rBEAST package:

library(rBEAST)

Extracting the phylogenies from the .trees file

Check if the example file can be found:

trees_file <- "example.trees"
testit::assert(file.exists(trees_file))

Parse the posterior:

posterior <- beast2out.read.trees(trees_file)

Investigating the posterior:

names(posterior)
testit::assert(length(posterior) == 10)

We can see that the posterior has multiple states.

Every state is a phylogeny:

testit::assert(class(posterior[[1]]) == "phylo")

We can plot these:

for (p in posterior) {
  plot(p)
}


olli0601/rBEAST documentation built on May 24, 2019, 12:53 p.m.