treeply.treedata: Run a function on the phylogeny of a 'treedata' object

Description Usage Arguments Value Examples

View source: R/treeplyr_functions.R

Description

Applies a function to the phylogeny in a treedata object. If the order of tips are changed, or if tips are dropped, then the data are automatically reordered to match the tree.

Usage

1
2
3
4
treeply(tdObject, ...)

## S3 method for class 'treedata'
treeply(tdObject, FUN, ...)

Arguments

tdObject

An object of class treedata

...

Additional arguments

FUN

A function that operates on an object of class 'phylo'

Value

An object of class treedata

Examples

1
2
3
4
5
6
7
data(anolis)
td <- make.treedata(anolis$phy, anolis$dat)
td2 <- treeply(td, drop.tip, 1:50)

par(mfrow=c(1,2))
plot(td$phy)
plot(td2$phy)

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