Skip to contents

Each cell's survey answer shares: one-hot answers in option order, averaged over valid answers

Usage

aggregate_survey(
  respondents,
  question,
  cell = "cell_id",
  answer = NULL,
  weight = NULL
)

Arguments

respondents

A data frame with one row per respondent.

question

A question from read_questions().

cell

Cell label column.

answer

Answer column, or NULL for the question id.

weight

Survey weight column, or NULL.

Value

Cells with the number of valid answers per cell as counts.