Skip to contents

Produces two bar charts comparing original and synthetic data: standardized differences for numeric columns and total variation distance for categorical columns. Requires ggplot2 (Suggests).

Usage

plot_comparison(comparison)

Arguments

comparison

A dataganger_comparison object from compare_synthetic().

Value

Invisibly, a list with two ggplot objects: numeric and categorical. Each is NULL if no columns of that type exist.

Examples

dat <- data.frame(x = 1:10, y = letters[1:10])
spec <- synth_spec(purpose = "demo")
syn <- synthesize_data(dat, spec)
cmp <- compare_synthetic(dat, syn)
#>  Not enough numeric columns (1) for correlation comparison.
#>   Need at least 2 numeric columns with non-zero variance.
if (requireNamespace("ggplot2", quietly = TRUE)) {
  plot_comparison(cmp)
}