Learn R Programming

MAPCtools (version 0.1.0)

aggregate_grouped_df: Aggregate grouped data using aggregate_df

Description

Aggregates a grouped data frame into summarizing statistics within groups by applying the aggregate_df function to each group. Aggregation is performed according to sufficient statistics for the specified distribution of the columns to be aggregated.

Usage

aggregate_grouped_df(
  data,
  by,
  gaussian = NULL,
  gaussian.precision.scales = NULL,
  binomial = NULL
)

Value

Aggregated data frame (tibble), with one row per group, containing grouping variables, count n per group, and aggregated list-columns for specified variables as returned by aggregate_df.

Arguments

data

Data frame to be grouped and aggregated.

by

Columns in data for which to group data by.

gaussian

Gaussian columns in grouped_data to be aggregated.
Defaults to NULL (optional).

gaussian.precision.scales

Scales for the precision of Gaussian observations.
See aggregate_df documentation for format details, and agaussian in INLA for more details. Defaults to NULL.

binomial

Binomial columns in grouped_data to be aggregated.
Defaults to NULL (optional).