closure_plot_ecdf | R Documentation |
Call closure_plot_ecdf()
to visualize CLOSURE results using
the data's empirical cumulative distribution function (ECDF).
A diagonal reference line benchmarks the ECDF against a hypothetical linear relationship.
See closure_plot_bar()
for more intuitive visuals.
closure_plot_ecdf(
data,
samples = c("mean", "all"),
line_color = "#5D3FD3",
text_size = 12,
reference_line_alpha = 0.6,
pad = TRUE
)
data |
List returned by |
samples |
String (length 1). How to aggregate the samples? Either draw a
single ECDF line for the average sample ( |
line_color |
String (length 1). Color of the ECDF line. Default is
|
text_size |
Numeric. Base font size in pt. Default is |
reference_line_alpha |
Numeric (length 1). Opacity of the diagonal
reference line. Default is |
pad |
Logical (length 1). Should the ECDF line be padded on the x-axis
so that it stretches beyond the data points? Default is |
The present function was inspired by
rsprite2::plot_distributions()
. However, plot_distributions()
shows
multiple lines because it is based on SPRITE, which draws random samples of
possible datasets. CLOSURE is exhaustive, so closure_plot_ecdf()
shows
all possible datasets in a single line by default.
A ggplot object.
# Create CLOSURE data first:
data <- closure_generate(
mean = "3.5",
sd = "2",
n = 52,
scale_min = 1,
scale_max = 5
)
# Visualize:
closure_plot_ecdf(data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.