add.data.to.tips: Adds data to the tip labels of a tree using a standard...

View source: R/add.data.to.tips.R

add.data.to.tipsR Documentation

Adds data to the tip labels of a tree using a standard formula

Description

This function is useful for adding data from one or more columns of a matrix to the tip labels of a tree

Usage

add.data.to.tips(tr, datMat, delim = "[_|]", returnNum = 1:2, returnDelim = "_",
addCols = c("GROUP"), uniques = F, addDelim = "|", reorderTree = TRUE, ...)

Arguments

tr

A phylo object

datMat

A matrix with row names equal to the tips you want to match in the tree, after passing the tip labels through label.elements, and columns you want to add indicated using addCols

delim

Delimiter for elements of the tip labels in the tree passed to the function, which will be used by label.elements to split the tip labels

returnNum

The delimited elements of the tree tip labels that you want back from label.elements

returnDelim

The delimiter to use in rebuilding the tip labels in label.elements

addCols

Which columns of datMat to add to the new tip labels

uniques

A boolean: if TRUE, any duplicate tip labels after passing through label.elements will be deleted

addDelim

The delimiter to go between the tip label and the elements being added

reorderTree

A boolean: if TRUE, the tree will be reordered so that the tip labels are in the plot.phylo order

...

Additional arguments passed along to label.elements

Value

A list:

tr.relabelled

An object of class phylo, relabelled

labelMat

An object of class matrix with original labels, the tips matched, the new elements added, the new labels, and whether the tip was retained or not

Author(s)

Andrew Hipp

See Also

label.elements color.tips.by.element section.coloring tidyName


andrew-hipp/morton documentation built on April 7, 2024, 12:15 p.m.