Subsplit()
removes leaves from a Splits
object.
Subsplit(splits, tips, keepAll = FALSE, unique = TRUE)
An object of class Splits
.
A vector specifying a subset of the leaf labels applied to split
.
logical specifying whether to keep entries that define trivial splits (i.e. splits of zero or one leaf) on the subset of leaves.
logical specifying whether to remove duplicate splits.
Subsplit()
returns an object of class Splits
, defined on the
leaves tips
.
KeepTip()
is a less flexible but faster equivalent.
Other split manipulation functions:
DropTip()
,
TrivialSplits()
splits <- as.Splits(PectinateTree(letters[1:9]))
splits
#> 6 bipartition splits dividing 9 tips, a .. i
efgh <- Subsplit(splits, tips = letters[5:8], keepAll = TRUE)
summary(efgh)
#> 4 bipartition splits (3 trivial) dividing 4 tips, e .. h
#> 1234
#> 12 ****
#> 15 .***
#> 16 ..**
#> 17 ...*
#>
#> Tip 1: e Tip 2: f Tip 3: g Tip 4: h
TrivialSplits(efgh)
#> 12 15 16 17
#> TRUE TRUE FALSE TRUE
summary(Subsplit(splits, tips = letters[5:8], keepAll = FALSE))
#> 1 bipartition split dividing 4 tips, e .. h
#> 1234
#> 16 ..**
#>
#> Tip 1: e Tip 2: f Tip 3: g Tip 4: h