Skip to contents

This function analyzes a data frame of coded excerpts to summarize counts of specified quality indicators by code. It filters excerpts to preferred coders per media title (if not already filtered), identifies excerpts where each quality indicator applies (logical TRUE), and returns a summary table counting how many excerpts for each code have each quality indicator applied.

Usage

quality_indicators(
  excerpts = NULL,
  preferred_coders = NULL,
  qual_indicators = NULL
)

Arguments

excerpts

A data frame containing excerpt data with logical code columns. Code columns should use clean variable names without prefixes or suffixes (e.g., "Priority excerpt").

preferred_coders

A character vector specifying coders in order of preference. Used to filter excerpts to only those from the highest-ranked coder per media title.

qual_indicators

A character vector of quality indicator code names to summarize. These should match the clean column names present in excerpts.

Value

A tibble grouped by Code containing counts of excerpts where each quality indicator was applied. Columns are named as "<quality_indicator>_Count". The output is arranged in descending order by these counts.

Details

  • The function expects the excerpts data frame to have logical columns representing codes.

  • It filters to preferred coders per media title to avoid duplicates.

  • It computes counts of excerpts for each code where each quality indicator was applied.

  • Input excerpts should be pre-cleaned with consistent code naming (e.g., using clean_data()).

Examples

if (FALSE) { # \dontrun{
# Assume 'df' is your cleaned excerpts data frame
preferred_coders <- c("Coder1", "Coder2")
qual_indicators <- c("Priority excerpt", "Heterogeniety")
quality_indicators(df, preferred_coders, qual_indicators)
} # }