compare_correlations: Mean absolute difference between correlation matrices

View source: R/compare.r

compare_correlationsR Documentation

Mean absolute difference between correlation matrices

Description

Over the numeric, date and binary categorical columns, Spearman correlations on pairwise complete rows.

Usage

compare_correlations(orig, syn, spec)

Arguments

orig, syn

Raw character data.frames in the same layout.

spec

The shared spec.

Value

list(mad = mean absolute difference, orig, syn matrices).

Examples

df <- data.frame(id = sprintf("AB%03d", 1:60), value = 1:60,
                 code = rep(c(0, 1, NA), 20))
path <- file.path(tempdir(), "compare_correlations.csv")
utils::write.csv(df, path, row.names = FALSE, na = "")
src <- read_source(path)
spec <- infer_spec(src)
syn <- src$raw
syn$value <- rev(syn$value)
compare_correlations(src$raw, syn, spec)

cellsynth documentation built on Oct. 31, 2026, 1:07 a.m.