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

## -----------------------------------------------------------------------------
template <- pcat_template("long", n_respondents = 2)
head(template)

## ----eval=FALSE---------------------------------------------------------------
# raw <- pcat_read_csv("completed_pcat.csv", layout = "auto")

## ----eval=FALSE---------------------------------------------------------------
# standard <- pcat_standardize(
#   raw_data,
#   respondent_id = "participant_code",
#   item_id = "question_number",
#   direction = "direction_response",
#   effect = "effect_response",
#   site_id = "clinic",
#   timepoint = "wave"
# )

## -----------------------------------------------------------------------------
validation <- pcat_validate(
  pcat_example_data(),
  require_complete = TRUE,
  action = "none"
)
validation
pcat_validation_issues(validation)

## ----eval=FALSE---------------------------------------------------------------
# pcat_validate(
#   data,
#   key_cols = c("project_id", "site_id", "timepoint", "respondent_id"),
#   require_complete = TRUE,
#   action = "error"
# )

