| plot_marginals | R Documentation |
plot_marginals() overlays the distributions of numeric variables
(density, histogram or empirical CDF) and shows side-by-side category
proportions for categorical variables. When the selected variables
contain both kinds, a list of two plots (class sp_plot_list) is
returned; printing it draws both.
plot_marginals(
real,
synthetic = NULL,
vars = NULL,
kind = c("density", "histogram", "ecdf"),
max_vars = 12L,
max_levels = 15L,
bins = 30L
)
plot_categorical(real, synthetic = NULL, vars = NULL, max_levels = 15L)
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 |
kind |
For numeric variables: |
max_vars |
Maximum number of variables of each kind shown by default. |
max_levels |
Maximum categories per categorical variable (the rest are pooled into "(other)"). |
bins |
Number of histogram bins. |
A ggplot object or an sp_plot_list.
syn <- synthesize(iris, seed = 1)
plot_marginals(iris, syn)
plot_marginals(iris, syn, vars = "Sepal.Length", kind = "ecdf")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.