View source: R/calculate_distribution_summary.R
calculate_distribution_summary | R Documentation |
Internal helper function to calculate comprehensive distribution statistics for a given metric grouped by a categorical variable. Used by create_hist(), create_density(), and create_boxplot() to ensure consistent output.
calculate_distribution_summary(plot_data, metric)
plot_data |
A data frame containing the metric data with columns:
|
metric |
Character string containing the name of the metric column |
A data frame with distribution statistics:
group
: The grouping variable
mean
: Mean of the metric
min
: Minimum value of the metric
p10
: 10th percentile of the metric
p25
: 25th percentile of the metric
p50
: 50th percentile (median) of the metric
p75
: 75th percentile of the metric
p90
: 90th percentile of the metric
max
: Maximum value of the metric
sd
: Standard deviation of the metric
range
: Range of the metric (max - min)
n
: Number of observations
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.