writeAncestors: Write a tree to file with ancestral states and (optionally)...

View source: R/writeAncestors.R

writeAncestorsR Documentation

Write a tree to file with ancestral states and (optionally) CIs at nodes

Description

This function writes a tree to file with ancestral character states and (optionally) 95% confidence intervals stored as node value.

Usage

writeAncestors(tree, Anc=NULL, file="", digits=6, format=c("phylip","nexus"), 
   ...)

Arguments

tree

a phylogenetic tree or set of trees as an object of class "phylo" or "multiPhylo".

Anc

a vector of ancestral states, a list containing the ancestral states and 95% confidence intervals (as from fastAnc or ace, or a list of such results.

file

an optional string with the filename for output.

digits

an integer indicating the number of digits to print for branch lengths and ancestral character values.

format

a string indicating whether to output the result in simple Newick (i.e., "phylip") or Nexus format.

...

additional arguments including x: a vector of character values, in which case ancestral states are estimated internally using fastAnc; and CI: a logical value indicating whether or not to estimate 95% confidence intervals.

Value

A file, string, or vector of strings.

Author(s)

Liam Revell liam.revell@umb.edu

References

Revell, L. J. (2024) phytools 2.0: an updated R ecosystem for phylogenetic comparative methods (and other things). PeerJ, 12, e16505.

See Also

ace, fastAnc, write.tree


phytools documentation built on June 22, 2024, 10:39 a.m.