Renders a correlation heatmap for small matrices, OR a top-N
effect-size lollipop chart for large matrices.
An earlier corrplot heatmap was unconditional, producing a
14,280x14,280 PNG (4.8 MB, browser-illegible) on a 228-variable
run. Above the max_inline_vars threshold
the function now switches to a ggplot2 horizontal lollipop showing
the top-N pairs ranked by absolute correlation, with significance
encoded by point color.
Usage
create_correlation_plot(
results,
output_path,
methodology_mode = NULL,
run_id = NULL,
max_inline_vars = 30L,
excluded_pairs = NULL
)Arguments
- results
CorrelationResults from calculate_correlations()
- output_path
File path for PNG output
- methodology_mode
Optional character. When supplied, adds a footer caption identifying the methodology mode + run.
- run_id
Optional character: run identifier.
- max_inline_vars
Integer; correlation matrices with more variables than this render as a top-N lollipop instead of a heatmap. Default 30L.
- excluded_pairs
Optional data frame (the
extract_significant()result) carryingvar1,var2, andexcluded_from_findings. Pairs flagged TRUE (analyst-internal / circular, e.g. an affect instrument x a theme-membership column) are shown but never presented as a significant finding – the heatmap blanks them (and discloses the count) and the lollipop marks them "excluded (circular)". NULL (default) reproduces the pre-#2b plot exactly.