R: Identify and remove trivial splits

TrivialSplits {TreeTools} | R Documentation

## Identify and remove trivial splits

### Description

`TrivialSplits()` identifies trivial splits (which separate one or zero leaves from all others); `WithoutTrivialSplits()` removes them from a `Splits` object.

### Usage

    TrivialSplits(splits, nTip = attr(splits, "nTip"))

    WithoutTrivialSplits(splits, nTip = attr(splits, "nTip"))

### Arguments

`splits` | An object of class `Splits`.
`nTip` | Integer specifying number of tips (leaves).

### Value

`TrivialSplits()` returns a logical vector specifying whether each split in `splits` is trivial, i.e. includes or excludes only a single tip or no tips at all.

`WithoutTrivialSplits()` returns a `Splits` object with trivial splits removed.

### Author(s)

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

### See Also

Other split manipulation functions: `Subsplit()`

### Examples

    splits <- as.Splits(PectinateTree(letters[1:9]))
    efgh <- Subsplit(splits, tips = letters[5:8], keepAll = TRUE)
    summary(efgh)

    TrivialSplits(efgh)
    summary(WithoutTrivialSplits(efgh))

[Package TreeTools version 1.3.1 Index]