Skip to contents

brand_summarize_attributes() counts raw attribute responses by brand and attribute for one stored attribute set.

Usage

brand_summarize_attributes(
  brand,
  set_name = "default",
  value_cols = NULL,
  which = c("sample", "sum", "mean", "sd"),
  cohort = NULL
)

Arguments

brand

A g6tr_brand object created with brand_create().

set_name

Name of the attribute set to summarize. Defaults to "default".

value_cols

Optional character vector of numeric columns to summarize.

which

Character vector selecting which numeric summaries to keep. Supported values are "sample", "sum", "mean", and "sd".

cohort

Optional cohort or cohort set. When supplied, summaries are restricted to those IDs and use brand$data$weight * cohort$weight.

Value

A tibble with columns brand, attribute, sample, and a packed responses column containing one count column per response option. When value_cols is supplied, one packed summary column is added for each selected value column.