name.check: Compares taxa in data and tree

Description Usage Arguments Value Author(s) Examples

Description

This function is a general tool for checking for concordance between a data file and a phylogenetic tree. For the data, names can be specified as the names of objects in the vector, rownames of the data array or as 'data.names'. The name.check function finds and lists all taxa present in data set but not in the tree, and vice-versa. The treedata function returns a list containing both the tree and the data after pruning out any species that are not found in both.

Usage

1
name.check(phy, data, data.names=NULL)

Arguments

phy

an object of class "phylo"

data

data for tips of the tree

data.names

names of the tips in the order of the data; if this is not given, names will be taken from the names or rownames of the object data

Value

Tree.not.data

Taxa in tree but not data

Data.not.tree

Taxa in data but not tree

...

Author(s)

Luke J. Harmon

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
data(geospiza)

tmp <- name.check(geospiza$phy, geospiza$dat)
tmp

## then match data to tree
newphy <- drop.tip(geospiza$phy, tip=tmp$tree_not_data)

## name check should now say "OK"
name.check(newphy, geospiza$dat)

## this can all be done in one step using treedata
td <- treedata(geospiza$phy, geospiza$dat)
td

all(td$phy$tip.label == newphy$tip.label)


Search within the geiger package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.