Learn R Programming

treeplyr (version 0.1.7)

treedply: Run a function on a treedata object

Description

Run a function on a treedata object

Usage

treedply(tdObject, ...)

# S3 method for treedata treedply(tdObject, ...)

Arguments

tdObject

A treedata object

...

A function call.

Value

Function output

Details

This function allows arbitrary R functions that use trees and data to be run on treedata objects.

Examples

Run this code
# NOT RUN {
data(anolis)
td <- make.treedata(anolis$phy, anolis$dat)
treedply(td, geiger::fitContinuous(phy, getVector(td, SVL), model="BM", ncores=1))
treedply(td, phytools::phylosig(phy, getVector(td, awesomeness), "lambda", test=TRUE))
treedply(td, phytools::phenogram(phy, getVector(td, SVL), ftype="off", spread.labels=FALSE))
# }

Run the code above in your browser using DataLab