Learn R Programming

TreeSearch (version 0.2.2)

UniqueSplits: Unique Splits

Description

Removes equivalent duplicates from a matrix of bipartitions.

Usage

UniqueSplits(splits, preserveParity = FALSE)

Arguments

splits

A vector of integers listing the number of tips in each of a number of tree splits (e.g. bipartitions). For example, c(3, 5) states that a character divides a set of eight tips into a group of three and a group of five.

preserveParity

Logical specifying whether to preserve the `TRUE` and `FALSE` status within each split (which takes marginally longer). If `FALSE`, each split will be defined such that taxa in the same partition as the first element are marked `FALSE`, and other taxa marked `TRUE`.

Value

The splits element, with all duplicate splits removed.

Examples

Run this code
# NOT RUN {
  set.seed(1)
  splits <- Tree2Splits(ape::rtree(6, br=NULL))
  UniqueSplits(splits, preserveParity=TRUE)

# }

Run the code above in your browser using DataLab