Skip to contents

This function was adopted and modified from treeio::write.beast to export a list of trees instead of a single tree.

Usage

write.beast.treedata(treedata, file = "",
                    translate = TRUE, tree.name = "STATE")

Arguments

treedata

An S4 class object of type treedata containing multiple trees; e.g. a Bayesian clock tree distribution imported using treeio::read.beast or treeio::read.mrbayes.

file

Output file. If file = "", prints the output content on screen.

translate

Whether to translate taxa labels.

tree.name

Name of the trees, default "STATE".

Value

Writes object type treedata containing multiple trees to a file or file content on screen

Examples

#Load file with multiple trees
if (FALSE) {
trees_file = system.file("extdata", "ex_offset.trees", package = "EvoPhylo")
posterior_trees_offset = treeio::read.beast(trees_file)

#Write multiple trees to screen
write.beast.treedata(posterior_trees_offset)
}