Skip to contents

Extracts the breakdowns summary with rack_extract_segment_breakdown(), renders this summary as an xlsx tab, appends it to a Workbook passed to wb parameter.

Usage

rack_render_segment_breakdown(rack, wb = NULL, quiet = FALSE)

Arguments

rack

A model rack to calculate summaries on.

wb

Workbook object to attach the rendered summary tab(s) to. If NULL, the default, an empty Workbook object will be initialized to contain the new tab(s).

quiet

Logical. If TRUE, suppresses warnings about missing required columns. Default is FALSE.

Examples

wb <- rack_render_segment_breakdown(example_seg_rack)

out_dir <- file.path(tempdir(), "g6tr.segmentation")
if (!dir.exists(out_dir)) dir.create(out_dir, recursive = TRUE)

openxlsx::saveWorkbook(
  wb,
  file.path(out_dir, "example_wb_segment_breakdowns.xlsx"),
  overwrite = TRUE
)