Skip to contents

pcat_write_analysis() writes a reproducible directory containing an analysis manifest, validation findings, optional classified responses, item summaries, consensus diagnostics, an optional action-plan worksheet, analysis settings, session information, and an optional profile PDF. pcat_save_profile_pdf() places one grouping combination on each page.

Usage

pcat_write_analysis(
  x,
  path,
  overwrite = FALSE,
  include_profile_pdf = TRUE,
  include_classified = TRUE,
  profile_label = c(
    "cfir_original_construct", "cfir_2022_construct", "item_text", "item_id"
  )
)

pcat_save_profile_pdf(
  data,
  path,
  group_vars = NULL,
  overwrite = FALSE,
  width = 11,
  height = 8.5,
  title_prefix = "pCAT profile",
  ...
)

Arguments

x

A pcat_analysis object returned by pcat_analyse().

path

Output directory for pcat_write_analysis() or output PDF path for pcat_save_profile_pdf().

overwrite

Logical; replace files previously generated by pcatR in the output directory. Unrelated files are retained.

include_profile_pdf

Logical; include a multi-page profile PDF in the analysis export.

include_classified

Logical; write respondent-item classifications to 02_classified_responses.csv. Set to FALSE when a response-level file is unnecessary or should not be distributed.

profile_label

Item-label field used in the exported profile PDF.

data

Raw, validated, or classified pCAT data.

group_vars

Grouping columns defining one PDF page.

width, height

PDF page dimensions in inches.

title_prefix

Prefix used in profile page titles.

...

Additional arguments passed to plot_pcat_profile().

Details

If summary tables were created with suppress_below, the classified response file and profile PDF do not automatically inherit that suppression. Review respondent-level and graphical outputs under the applicable privacy and disclosure rules before dissemination. When overwrite = TRUE, only known files generated by pcat_write_analysis() are removed before the new export is written.

Value

The normalized output directory or file path, invisibly.

Examples

analysis <- pcat_analyse(
  pcat_example_data(),
  group_vars = c("site_id", "timepoint"),
  validation_action = "none"
)

if (FALSE) { # \dontrun{
pcat_write_analysis(
  analysis,
  path = "pcat_analysis_outputs",
  overwrite = TRUE,
  include_classified = FALSE
)

pcat_save_profile_pdf(
  analysis$classified,
  path = "pcat_profiles.pdf",
  group_vars = c("site_id", "timepoint"),
  overwrite = TRUE
)
} # }