AllQuartets: List all quartets

AllQuartetsR Documentation

List all quartets

Description

Lists all choices of four taxa from a tree.

A more computationally efficient alternative to combn.

Usage

AllQuartets(nTips)

## S3 method for class 'numeric'
AllQuartets(nTips)

## S3 method for class 'phylo'
AllQuartets(nTips)

Arguments

nTips

Integer, specifying the number of tips in a tree; or a tree, whose tips will be counted.

Value

AllQuartets() returns a matrix with four rows and choose(n_tips, 4) columns, with each column corresponding to a unique selection of four different integers less than or equal to nTips.

Author(s)

Martin R. Smith (martin.smith@durham.ac.uk)

See Also

States of quartets in given trees: QuartetStates()

Other quartet counting functions: CompareQuartets(), CompareQuartetsMulti(), ResolvedQuartets()

Examples

AllQuartets(5)
 
combn(5, 4) # Provides the same information, but for large 
            # values of n_tips is significantly slower.


ms609/SlowQuartet documentation built on April 22, 2024, 5:41 p.m.