Learn R Programming

treeplyr (version 0.1.7)

summarise.treedata: Function for summarizing an object of class treedata

Description

This function can be used to summarize a treedata object.

Usage

# S3 method for treedata
summarise(.data, ...)

# S3 method for grouped_treedata summarise(.data, ...)

Arguments

.data

An object of class treedata

...

Additional expressions by which to summarize data in the treedata object

Value

An object of class tbl_df with the requested summary data.

Details

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.

See Also

summarize, group_by

Examples

Run this code
# NOT RUN {
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))
# }

Run the code above in your browser using DataLab