Skip to contents

Transforms long-format data to wide format and computes a correlation matrix across iterations.

Usage

compute_correlation_matrix(x, value_col, iter_col, method = "pearson")

Arguments

x

A data frame or data.table with columns `feature`, a user-defined iteration column, and a value column.

value_col

The name of the column to pivot on (e.g., "p_value" or "T_obs").

iter_col

The name of the column to treat as "iteration" (e.g., "sample_id", "perm_id").

method

Correlation method: one of "pearson", "spearman", or "kendall".

Value

A correlation matrix with NA on the diagonal.