Learn R Programming

SynthesizerPlus (version 0.4.0)

plot_pairs: Scatter-plot matrix of real and/or synthetic data

Description

Pairwise scatter plots of numeric variables, with real and synthetic records side by side (columns of the panel grid are variables, the colour identifies the source). Useful to inspect multivariate structure, also for data generated with r_mvdist() or mvdist functions.

Usage

plot_pairs(
  real,
  synthetic = NULL,
  vars = NULL,
  max_points = 1500L,
  alpha = 0.35
)

Value

A ggplot object.

Arguments

real

A data frame (or vector/matrix) with the real data.

synthetic

Optional synthetic data with the same columns.

vars

Variables to plot (default: all, up to max_vars per kind).

max_points

Maximum number of points drawn per data set.

alpha

Point transparency.

Examples

Run this code
syn <- synthesize(iris, seed = 1)
plot_pairs(iris, syn, vars = c("Sepal.Length", "Petal.Length", "Petal.Width"))

x <- as.data.frame(r_copula(1000, "clayton", dim = 3, theta = 3, seed = 1))
plot_pairs(x)

Run the code above in your browser using DataLab