Translating phylogenies {phyreg} | R Documentation |
Using phylogenies formatted in standard but "other" ways
Description
The two functions convert phylogenies in a standard format (newick or phylo) into a form that can be supplied as the argument phydata
of phyreg
. If node heights are specified, these are also provided in the value returned.
Usage
phyfromnewick(file = "", text)
phyfromphylo(phylo)
Arguments
file |
a textfile containing the newick phylogeny, which must end with a semi-colon ( |
text |
a character variable containing the newick phylogeny, which must end with a semi-colon. Exactly one of these arguments should be supplied ( |
phylo |
an R-variable containing a "phylo" object, as used, for example, in the |
Details
Before passing the text to read.newick
, I strip out all the spaces, to avoid problems.
phyfromnewick
contains a function read.newick
which "reads Newick style tree with branch lengths into memory as an ape
"phylo" object", and was written by Liam J. Revell in 2011, and downloaded on 24th January 2014. See references for url.
Examples are given under phyreg
.
Value
phy |
The phylogenetic vector in internal format, with an element for every node, except the root, but including species. If |
hts |
The heights of each node, a vector with an element for every node. Thus it is longer by one than $phy. Suitable for supplying as the |
orphylo |
The "phylo" style object created by |
Author(s)
Alan Grafen,
with an internal function (read.newick
) written by Liam J. Revell in 2011, downloaded on 24th January 2014. See references for url.
References
https://github.com/liamrevell/phytools/blob/master/R/read.newick.R