Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

allFurcTrees

Generate all bi- and multifurcating unrooted trees


Description

This function creates all possible unrooted bi- and multifurcating trees and returns a list of trees as an object of class "multiPhylo".

Usage

allFurcTrees(n, tip.label=NULL, to.plot=TRUE)

Arguments

n

an integer giving the desired number of species.

tip.label

an optional vector of length n containing the tip names.

to.plot

an optional logical value indicating whether or not to plot the trees.

Details

This function should be used with caution for n greater than about 8, as in this case the number of possible trees is extremely large.

Value

A list of trees as an object of class "multiPhylo".

Author(s)

References

Felsenstein, J. 2004. Inferring Phylogenies. Sinauer.

Revell, L. J. (2012) phytools: An R package for phylogenetic comparative biology (and other things). Methods Ecol. Evol., 3, 217-223.

See Also

Examples

## compute & plot all bi- and multifurcating
## trees for six taxa
trees<-allFurcTrees(n=6)
par(mfrow=c(16,15))
nulo<-sapply(trees,plot,type="unrooted",
    no.margin=TRUE)
par(mfrow=c(1,1))

phytools

Phylogenetic Tools for Comparative Biology (and Other Things)

v0.7-70
GPL (>= 2)
Authors
Liam J. Revell
Initial release
2020-9-19

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.