summarizer: Function to generate group-counts and percentages

Description Usage Arguments Value

View source: R/summarizer.R

Description

Function to generate group-counts and percentages

Usage

1
summarizer(df, group_cols, output_prefixs)

Arguments

df

Data-frame with each row corresponding to an observation you want counted by groups.

group_cols

Character-vector of columns to group the dataframe by, in order of order you want the grouping done.

output_prefixs

Character-vector of equal length as the group_cols with prefixes for output columns corresponding to each group_col; e.g., "type" if you're grouping by type will produce type_num and type_pct.

Value

A summary dataframe with information on the number of observations per each group/combination of groups in order. E.g., c(animal, breed, likeability) will group by animal, then animal/breed, then animal/breed/likeability, and calculate the percentage of each animal group of all animals, of each animal/breed group of each animal group, and of each animal/breed/likeability group of each animal/breed group.


dpowerstp/arrprocess documentation built on Dec. 20, 2021, 1:12 a.m.