supporting.tips: Get all pairs of tips defining a node

View source: R/supporting_tips.R

supporting.tipsR Documentation

Get all pairs of tips defining a node

Description

For a given tree and a given node of this tree, this function outputs all pairs (or more if polytomies) of tips whose MRCA (most recent common ancestor) is that node of that tree

Usage

supporting.tips(tree,node,out=c("list","comb"),out.collapse=" - ",mandatory=FALSE)

Arguments

tree

Phylogenetic tree to consider

node

Node to consider. Can be the node number (from 1 to the number of nodes, or from the number of tips +1 to the number of tips + number of nodes)

out

The type of output. Can be a list (if out="list", the default) containing vectors of tip labels; can be a vector (if out="comb") collating tip labels

out.collapse

The way to collate tip labels if a vector is desired as output. Default is set to " - "

mandatory

Logical, whether "mandatory tips" (tips always found to structure the node, likely one of the direct daugher taxa of the given node) should be returned. Default to FALSE

Examples

require(ape)
# Get a random tree of 20 tips
set.seed(1)
tree<-rtree(20)
plot(tree)
nodelabels()
# To see which node is "structuring" the node 27
supporting.tips(tree,27)
# Same with the vectorized output
supporting.tips(tree,27,"comb")
# One of the direct daughter taxa of the node 27 is the taxon t17, so it is a "mandatory" tip (i.e., always in the combinations)
supporting.tips(tree,27,mandatory=TRUE)

jacobmaugoust/ULT documentation built on May 16, 2023, 1:29 p.m.