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

View source: R/treeplyr_functions.R

treeplyR Documentation

Run a function on the phylogeny of a treedata object

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

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

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)


uyedaj/treeplyr documentation built on March 9, 2023, 6:37 p.m.