powered by
Apply a function over all treedata object columns and return a list of results, analogously to the normal apply function
tdapply(tdObject, MARGIN, FUN, ...)
A treedata object
the margin over which the data is applied (e.g. 1 = rows, 2 = columns)
A function to apply over the data frame
Additional parameters passed on to FUN
Note that if the parameter phy is specified in the additional parameters (i.e. '...'), then it will be substituted with the treedata object $phy.
phy
treedata
$phy
# NOT RUN { data(anolis) td <- make.treedata(anolis$phy, anolis$dat) td %>% forceNumeric(.) %>% tdapply(., 2, phytools::phylosig, tree=phy) # }
Run the code above in your browser using DataLab