tree_from_taxa {castor}R Documentation

Construct a rooted tree from lists of taxa.

Description

Given a collection of taxon lists, construct a rooted taxonomic tree. Each taxon list is defined by a parent name and the names of its children (i.e., immediate descendants).

Usage

tree_from_taxa(taxa)

Arguments

taxa

Named list, whose elements are character vectors, each representing a parent and its children. The element names of taxa are parents. Each element taxa[n] is a character vector listing an arbitrary number of taxon names (the children), which immediately descend from taxon names(taxa)[n].

Details

The following rules apply:

Since the returned tree is a taxonomy, it will contain no edge lengths.

Value

A rooted tree of class "phylo".

Author(s)

Stilianos Louca

See Also

consensus_taxonomies, place_tips_taxonomically

Examples

# define a list of taxa, with taxon "A" being the root
# Taxa G, H, I, J, K, L, M, N and O will be tips
taxa = list(A = c("B","C","D"), 
            B = c("E","I"), 
            C = c("J","F"), 
            D = c("M", "N", "O"), 
            E = c("G", "H"),
            F = c("K", "L"))
tree = castor::tree_from_taxa(taxa)

[Package castor version 1.8.2 Index]