Learn R Programming

LMMELSM (version 0.2.0)

.tidy_summary: Takes stan summary, returns summary with indices-as-columns.

Description

Creates "tidy" summaries in lieu of the stan rownames.

Usage

.tidy_summary(x, labs = NULL, ...)

Value

Data frame.

Arguments

x

Output of .summarize

labs

The labels for each parameter index. E.g., "predictor", "factor"

...

Optional (but recommended). Mappings for indices. E.g., Index column 1 is replaced by ...[[1]][col1Indices].

Author

Stephen R. Martin

Details

.summarize creates an rstan-like summary with rownames, mat[1:R, 1:C]. .tidy_summary(mat, c("rows", "cols")) would then create two new columns, "rows" and "cols" with the indices in them. If arguments are provided in ..., then these indicate the mappings between the indices and labeled values. E.g., .tidy_summary(mat, c("rows", "cols"), c("A", "B"), c("C", "D")) would create two new columns, "rows" and "cols", and replace rows = 1 with rows = A; cols=2 with cols = D, and so on. Useful for going from stan rownames, to labeled columns.