treedata: compare taxa in data and tree

View source: R/utilities-phylo.R

treedataR Documentation

compare taxa in data and tree

Description

matching species found in a comparative dataset

Usage

treedata(phy, data, sort=FALSE, warnings=TRUE)

Arguments

phy

a phylogenetic tree of class 'phylo'

data

a named vector or matrix of continuous trait values, for species in phy

sort

whether to sort the data based on names found in phy

warnings

whether to report warnings of mismatched taxa between phy and data

Details

This function is a general tool for checking for concordance between a data object and a phylogenetic tree. For the data, names can be specified as the names of objects in the vector or rownames of the data array.

Value

The function returns a list of two elements (phy and data) that are manipulated to include only those species found in both the tree and data supplied by the user.

Author(s)

LJ Harmon

Examples


geo <- get(data(geospiza))

treedata(geo$phy, geo$dat, sort=TRUE, warnings=TRUE)


geiger documentation built on April 4, 2023, 1:07 a.m.