Skip to contents

Unlike sframe_plot_descriptives(), which summarises skewness and kurtosis across the variables in a sframe_descriptives_results() table, this operates on one variable's raw values directly (the report table only stores summary statistics, not the underlying vector), matching the pattern sframe_plot_correlation_matrix() already uses for report-independent, data-driven plots.

Usage

sframe_plot_variable_distribution(data, variable, palette = c("web", "print"))

Arguments

data

A data frame of survey responses.

variable

Character. Column name of the variable to plot.

palette

One of "web" or "print". See sframe_brand().

Value

A named list of 3 ggplot2 objects (histogram, boxplot, qq), or NULL if fewer than 2 complete values remain.

Examples

# \donttest{
if (requireNamespace("ggplot2", quietly = TRUE)) {
  demo <- sframe_demo("tourism_services")
  panels <- sframe_plot_variable_distribution(demo$responses, "sat_1")
  panels$histogram
}
# }