PCMTreeMatchLabels: Get the node numbers associated with tip- or node-labels in a...

View source: R/PCMTree.R

PCMTreeMatchLabelsR Documentation

Get the node numbers associated with tip- or node-labels in a tree

Description

Get the node numbers associated with tip- or node-labels in a tree

Usage

PCMTreeMatchLabels(tree, labels, stopIfNotFound = TRUE)

Arguments

tree

a phylo object

labels

a character vector with valid tip or node labels from tree

stopIfNotFound

logical indicating if an error should be raised in case a label has not been found in the tree labels. Default: TRUE

Value

an integer vector giving the tip- or node- integer indices corresponding to labels. If stopIfNotFound is set to FALSE, this vector may contain NAs for the labels that were not found.

Examples

set.seed(1, kind = "Mersenne-Twister", normal.kind = "Inversion")
PCMTreeMatchLabels(PCMTree(ape::rtree(20)), c("t1", "t15", "21", "39"))
PCMTreeMatchLabels(PCMTree(ape::rtree(20)), c("t1", "45"), stopIfNotFound = FALSE)

venelin/PCMBase documentation built on March 14, 2024, 8:24 p.m.