make.treedata: Function for making an object of class 'treedata'

Description Usage Arguments Value Examples

View source: R/treeplyr_functions.R

Description

This function generates an object of class treedata that ensures that the ordering of tip labels and data remain intact. The object can be manipulated using dplyr functions.

Usage

1
make.treedata(tree, data, name_column = "detect", as.is = FALSE)

Arguments

tree

An object of class 'phylo'

data

A data frame or matrix

name_column

An optional argument that specifies the column of data that contains the names to be matched to the tree. By default, it is set to "detect" which finds the column with the most matches to the tree (including the rownames).

as.is

Whether convert to factors. When FALSE (default), convert character vectors to factors.

Value

An object of class "treedata". The tree is pruned of tips not represented in the data, and the data is filtered for taxa not in the tree. The data is returned as a data frame tble that is compatible with dplyr functions.

Examples

1
2

treeplyr documentation built on Sept. 17, 2020, 5:07 p.m.