norm_dist_plot: Create density histogram with normal distribution overlaid

View source: R/norm_dist_plot.R

norm_dist_plotR Documentation

Create density histogram with normal distribution overlaid

Description

Plots a simple density histogram for a continuous variable with a normal distribution overlaid. The overlaid normal distribution has the same mean and standard deviation as the provided variable, and the plot provides a visual means to assess the normality of the variable's distribution.

Usage

norm_dist_plot(df, vars)

Arguments

df

A data.frame or tibble.

vars

A character vector of continuous variable names.

Value

A ggplot object.

Examples

norm_dist_plot(df = iris, vars = "Sepal.Width")

norm_dist_plot(df = iris,
               vars = c("Sepal.Width", "Sepal.Length"))

craigjmcgowan/helpR documentation built on Jan. 14, 2025, 5:25 a.m.