Skip to contents

A static ggplot2 figure of the grid the correlation matrix opens on: one cell per pair of variables, coloured by R's coefficient and labelled with it, across biomarkers at one visit or across the visits of one biomarker. It is the grid Widget_CorrelationMatrix() draws in the browser, from the same settings, and its coefficients are Analyze_CorrelationMatrix()'s on the same frame. A cell R did not compute, too few pairs among them, is left blank.

Usage

Visualize_CorrelationMatrix(
  dfResults,
  dfParticipants = NULL,
  lSettings = list()
)

Arguments

dfResults

data.frame Long-format results, one row per participant, biomarker and visit. Column names are supplied by lSettings; the defaults expect USUBJID/TEST/STRESN/VISIT/VISITNUM/STRESU, the columns of Synthetic_Results.

dfParticipants

data.frame One row per participant, or NULL. With it the chart has filters; it also says who the participants are. Default: NULL.

lSettings

list bio.viz correlation matrix settings, as Widget_CorrelationMatrix() takes them, and title, subtitle and footnotes. Default: list().

Value

A ggplot object.

Titles and footnotes

The settings title, subtitle and footnotes are text with named placeholders, as for Visualize_GroupComparison(). This figure fills {heading} (what the grid is of), {variables} (how many), {visit}, {value}, {n} (the participants in the frame), {filters}, {date} and {version}.

Examples

if (requireNamespace("ggplot2", quietly = TRUE)) {
  Visualize_CorrelationMatrix(
    Synthetic_Results,
    Synthetic_Participants,
    lSettings = list(visit = "Baseline", title = "{heading}")
  )
}