heirarchicalSummary: Hierarchical Summary

Description Usage Arguments Value Examples

Description

Summarise a data frame at cascading levels of granularity

Usage

1
heirarchicalSummary(collapse, hold, rawData, ...)

Arguments

collapse

A character vector of variables to group the data frame by, which will be succesively collapsed over.

hold

A character vector of variables to consistently group the data frame by, even while other variables are collapsed

rawData

The data frame to summmarise iteratively

...

Name-value pairs of summary functions like mean(), sd() etc. See details for warnings about naming conventions

Value

A list of tbl_df's, the same length as the character vector passed as the collapse argument

Examples

1
2
3
4
5
6
7
derp <- heirarchicalSummary(collapse = c("subject","group"),
                            hold = c("practice","other_type",
                                     "prac_score", "other_prac_acc"),
                            rawData=ungroup(cbind(LB4L_allSs,n=1)),
                            weighted.mean(final_score,n), mean(final_score),
                            n = sum(n))
str(derp)

wjhopper/FAM documentation built on May 4, 2019, 7:33 a.m.