tdapply: Apply a function over all treedata object columns and return...

Description Usage Arguments Details Examples

View source: R/treeplyr_functions.R

Description

Apply a function over all treedata object columns and return a list of results, analogously to the normal apply function

Usage

1
tdapply(tdObject, MARGIN, FUN, ...)

Arguments

tdObject

A treedata object

MARGIN

the margin over which the data is applied (e.g. 1 = rows, 2 = columns)

FUN

A function to apply over the data frame

...

Additional parameters passed on to FUN

Details

Note that if the parameter phy is specified in the additional parameters (i.e. '...'), then it will be substituted with the treedata object $phy.

Examples

1
2
3
data(anolis)
td <- make.treedata(anolis$phy, anolis$dat)
td %>% forceNumeric(.) %>% tdapply(., 2, phytools::phylosig, tree=phy)

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

Related to tdapply in treeplyr...