## ----setup, include=FALSE-----------------------------------------------------
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")
library(pcatR)

## -----------------------------------------------------------------------------
classified <- pcat_classify(pcat_example_data())
summary <- pcat_summarise(
  classified,
  group_vars = c("site_id", "timepoint")
)
consensus <- pcat_consensus(summary)
head(consensus[c(
  "site_id", "timepoint", "item_id", "dominant_side",
  "agreement_share", "polarized", "normalized_entropy", "consensus_label"
)])

## -----------------------------------------------------------------------------
change <- pcat_change(
  classified,
  from = "planning",
  to = "mid_implementation"
)
head(change[c(
  "respondent_id", "item_id", "from_pcat_class5", "to_pcat_class5",
  "delta_display_code", "transition"
)])

## -----------------------------------------------------------------------------
suppressed <- pcat_summarise(
  classified,
  group_vars = c("site_id", "timepoint"),
  suppress_below = 5
)
head(suppressed)

