Description Usage Arguments Details Value Examples
Converts a table of taxa into a phylogenetic tree or matrix. The phylogenetic tree produced will be rooted with a topology corresponding to the child-parent relationships encoded in the table and branch lengths determined by the ages of taxa provided in the table. The phylogenetic matrix produced records the distribution of child taxa amongst parent taxa.
1 | treemakr(x, output)
|
x |
is a
|
output |
is a |
treemakr
takes a table of child-parent relationships among
taxa and converts to a phylogenetic tree or matrix. The table could be
encoded from a published phylogenetic tree, for which no newick or nexus
file is available, or from a hierarchical taxonomy. If a tree is desired,
node ages are required but these could be arbitrary (e.g. representing
taxonomic level).
If output="matrix"
, a binary matrix
is returned with a
row for each tip and a column for each internal and terminal (tip) node. If
a tip is descendant from that node, the matrix records that relationship as
a 1, and 0 otherwise. If output="tree"
, a phylo
object (see
ape
package) is returned. If the taxa in x
are not in
cladewise order, the resulting tree will not plot correctly in ape
(the plot function requires trees to be organised in cladewise order). This
can be easily fixed by writing the tree to a Newick or Nexus file (using
the write.tree
or write.nexus
in the ape
package) and
then reading the file back into R.
1 2 | data(bandicoot_table)
plot(treemakr(bandicoot_table,output="tree"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.