Description Usage Arguments Value Author(s) Examples
Extract a BEAST2 posterior from a file
1 | get_posterior(file, sti, ai, pi)
|
file |
A loaded parameter file |
sti |
the species tree index, a value from 1 to and including 2 |
ai |
the alignment index, the ai-th alignment of that species tree, a value from 1 to and including the number of alignments per species tree |
pi |
the posterior index, the pi-th posterior of that alignment, a value from 1 to and including the number of posteriors per alignment |
the posterior
Richel Bilderbeek
1 2 3 4 5 6 7 8 9 10 11 12 | # Read a file with one or more posteriors
file <- read_file(find_path("toy_example_1.RDa"))
# Pick the indices of the posterior to extract
sti <- 1 # Species tree index
ai <- 1 # Alignment index
pi <- 1 # Posterior index
# Extract the posterior
posterior <- get_posterior(file = file, sti = sti, ai = 1, pi = 1)
# Check that it is indeed a posterior of non-zero length
testit::assert(all(names(posterior) == c("trees", "estimates")))
testit::assert(tracerer::is_posterior(posterior))
testit::assert(length(posterior) > 0)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.