Skip to contents

Perform group by and summarise operations on selected grouping columns and compute summary statistics within each group. This function uses dplyr's group_by function for creating groups and summarise for computing summary statistics.

Usage

group_by_summarise(in_df, group_var, summ_var)

Arguments

in_df

a layer (spatial (sf) or non-spatial data frame) to summarise.

group_var

a character vector of column names to group by - uses dplyr's group_by function.

summ_var

A character vector of columns names to compute grouped summary statistics for - uses dplyr's summarise. For all numeric columns the mean and sum are computed. For numeric and non-numeric columns the count of observations within each group is returned.

Value

a summary table as a data frame (s_df) object.