This function writes one or more trees to a file in binary format.

write_binary_trees(trees, file, additional_data = vector("raw", 0))

Arguments

trees

An object of class "phylo" or "multiPhylo".

file

A file name.

additional_data

A vector of mode raw containg additional binary data that will be included within the tree file.

Details

This function writes all the trees at once. If you wish to write the trees one at a time, you should use the keep_writing_binary_trees function.

This function will analyse all the trees to determine whether it is appropriate to include any names or attributes in the file header. It will then write the header, the trees and conclude the file with an appropriate trailer.

The tip names can be specified either as a Name element in the tree's tip.attributes element, or as the tip.label element of the tree. If both are specified, the values stored in the Name attribute take precedence (this allows backward compatibility for trees created using ape).

The node names and support values can similarly be specified either with a Name or Support element in the tree's node.attributes, or as the tree's node.label. If all the node labels can be parsed as numbers, they will be assumed to contain support values; otherwise, they will be assumed to contain node names. If the node.attributes already contain a Name or Support element, the node labels will be ignored.

The additional binary data (if any) will be written in the file after the trees and before the trailer.

References

https://github.com/arklumpus/TreeNode/blob/master/BinaryTree.md

See also