View source: R/treeplyr_functions.R
| summarise.treedata | R Documentation |
treedataThis function can be used to summarize a treedata object.
## S3 method for class 'treedata'
summarise(.data, ...)
## S3 method for class 'grouped_treedata'
summarise(.data, ...)
.data |
An object of class |
... |
Additional expressions by which to summarize data in the |
Summarizing treedata objects allows expressions using the objects phy. The treedata
object can also be grouped, with summary statistics being applied to the pruned groups and phylogenies.
An object of class tbl_df with the requested summary data.
summarize, group_by
data(anolis)
td <- make.treedata(anolis$phy, anolis$dat)
summarize(td, ntips = length(phy$tip.label), meanSVL = mean(SVL), sdSVL = sd(SVL))
tdGrouped <- group_by(td, ecomorph)
summarize(tdGrouped, ntips = length(phy$tip.label),
totalBL = sum(phy$edge.length), meanSVL = mean(SVL), sdSVL = sd(SVL))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.