View source: R/mcmc2multiphylo.R
mcmc2multiphylo | R Documentation |
Convert an MCMC sample from MCMCTree or BPP to a list of trees
mcmc2multiphylo(tree, mcmc, time.name, thin)
tree |
an object of class phylo |
mcmc |
data frame with an MCMC sample from MCMCTree or a BPP A00 analysis |
time.name |
character vector of length one, this is usually
|
thin |
numeric, the fraction of MCMC samples to keep |
tree
must be rooted and strictly bifurcating, and it must
match (i.e, it must use the same Newick representation) as the tree used by
BPP or MCMCTree to obtain the MCMC sample. The function uses the node ages
in mcmc
to calculate branch lengths and generate a list of trees
(with the same topology as tree
), one tree per (thinned) MCMC
sample. The tips of the phylogeny are assumed to have age zero.
An object of class multiPhylo (i.e., a list of trees).
Mario dos Reis
# hominid MCMC sample from BPP:
data(hominids)
hominid.trees <- mcmc2multiphylo(hominids$tree, hominids$mcmc, "tau_", 0.001)
## Not run:
# If you have the ape package installed, you can output the trees in
# Newick format
ape::write.tree(hominid.trees)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.