This function aggregates event report data based on a specified grouping variable and various aggregation criteria.
aggregateData(
data,
group_var = "event_id",
find_mode = NULL,
find_mode_na_ignore = NULL,
find_mode_bin = NULL,
find_mode_date = NULL,
find_mode_numeric = NULL,
find_least_precise = NULL,
find_most_precise = NULL,
combine_strings = NULL,
find_max = NULL,
find_min = NULL,
summarize_vars = NULL,
aggregation_name = NULL,
tie_break = "default_tie_break",
second_tie_break = "default_tie_break"
)A data frame with the aggregated results.
A data frame containing the data to be aggregated.
A string specifying the variable to group by. Default is "event_id".
A vector of variable names for which to find the mode.
A vector of variable names for which to find the mode, ignoring NAs.
A vector of variable names for which to find the binary mode.
A vector of variable names for which to find the mode for dates.
A vector of variable names for which to find the mode for numeric values.
A list of lists, each containing a variable name and its corresponding precision variable, to find the least precise value.
A list of lists, each containing a variable name and its corresponding precision variable, to find the most precise value.
A vector of variable names for which to combine strings.
A vector of variable names for which to find the maximum value.
A vector of variable names for which to find the minimum value.
A vector of variable names for which to sum all values.
A string specifying the name of the aggregation.
A string specifying the tie break column name. Default is "default_tie_break".
A string specifying the second tie break column name. Default is "default_tie_break".
small_maverick_event_report %>%
aggregateData(group_var = "event_id", find_mode = "city") %>%
utils::head(10)
Run the code above in your browser using DataLab