aggregate_df {MAPCtools} | R Documentation |
Aggregate data across an entire data frame using sufficient statistics
Description
Aggregates specified columns of a data frame into summarizing statistics, preserving the potentially complex structure returned by aggregator functions (like data frames or inla.mdata objects) within list-columns. Aggregation is performed according to sufficient statistics for the specified distribution of the columns. Possible distributions: Gaussian, binomial. This function aggregates the entire data frame into a single row result.
Usage
aggregate_df(
data,
gaussian = NULL,
gaussian.precision.scales = NULL,
binomial = NULL
)
Arguments
data |
A data frame. |
gaussian |
Gaussian columns in |
gaussian.precision.scales |
Scales for the precision of Gaussian observations.
|
binomial |
Binomial columns in |
Value
A single-row data frame (tibble) containing:
A column
n
with the total number of rows in the input data.For each specified column in
gaussian
,binomial
, a corresponding list-column (named e.g.,colname_gaussian
,colname_binomial
. Each element of these list-columns can be accessed by using the$
operator twice, e.g. throughdata$colname_gaussian$Y1
for the first element of the Gaussian summary.