Skip to contents

Majority() returns the majority-rule consensus (Margush and McMorris 1981) : the tree containing each split that occurs in more than half of the input trees. Raising p retains only splits present in a greater proportion of trees, up to the strict consensus at p = 1.

Usage

Majority(trees, p = 0.5)

MajorityRule(trees, p = 0.5)

MR(trees, p = 0.5)

Arguments

trees

A list of trees, or a multiPhylo object; all entries must share the same leaf labels.

p

Numeric between 0.5 and 1: the minimum proportion of trees that must contain a split for it to be retained. p = 0.5 (the default) gives the majority-rule consensus; p = 1 gives the strict consensus.

Value

Majority() returns the consensus tree, an object of class phylo, rooted as in the first entry of trees.

Details

The majority-rule consensus belongs to the family of consensus methods for which Jansson and colleagues developed asymptotically efficient algorithms (Jansson et al. 2016) – the algorithmic backbone of this package – and which their FACT toolkit implements. This particular method is a thin wrapper around TreeTools::Consensus(), to which the computation is delegated.

References

Jansson J, Shen C, Sung W (2016). “Improved algorithms for constructing consensus trees.” Journal of the ACM, 63(3), 1–24. doi:10.1145/2925985 .

Margush T, McMorris FR (1981). “Consensus n-trees.” Bulletin of Mathematical Biology, 43(2), 239–244. doi:10.1007/BF02459446 .

Examples

trees <- ape::as.phylo(0:5, 8)
Majority(trees)
#> 
#> Phylogenetic tree with 8 tips and 5 internal nodes.
#> 
#> Tip labels:
#>   t1, t2, t3, t4, t5, t6, ...
#> 
#> Rooted; no branch length.