tdt: Run a function on a 'treedata.table' object

Description Usage Arguments Details Value Examples

View source: R/tdt.R

Description

Run a function on a treedata.table object

Usage

1
tdt(tdObject, ...)

Arguments

tdObject

A treedata.table object

...

A function call.

Details

This function allows R functions that use trees and data to be run ontreedata.table objects.

Value

Function output for a single tree (phylo) or a list of function outputs (one per each tree in the MultiPhylo object)

Examples

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


# A treedata.table object with a phylo $phy
td <- as.treedata.table(anolis$phy, anolis$dat)
tdt(td, geiger::fitContinuous(phy, extractVector(td, "SVL"),
  model = "BM", ncores = 1
))


# A treedata.table object with a multiPhylo $phy
treesFM <- list(anolis$phy, anolis$phy)
class(treesFM) <- "multiPhylo"
td <- as.treedata.table(treesFM, anolis$dat)
tdt(td, geiger::fitContinuous(phy, extractVector(td, "SVL"),
  model = "BM",
  ncores = 1
))

treedata.table documentation built on Oct. 23, 2020, 5:50 p.m.