## Load example dataset safely
data(diamonds, package = "ggplot2")
## Example 1: Boxplots with Shapiro-Wilk test (n <= 5000)
plot_norm(
data = diamonds[1:4000, ],
vars = c("carat", "x", "y"),
geom = "box"
)
## Example 2: Histograms with Shapiro-Wilk test (n <= 5000)
plot_norm(
data = diamonds[1:4000, ],
vars = c("carat", "x", "y"),
geom = "hist",
bins = 20,
p.ypos = 0.6
)
## Example 3: Kolmogorov-Smirnov test automatically applied (n > 5000)
plot_norm(
data = diamonds[1:6000, ],
vars = c("carat", "x"),
geom = "hist",
bins = 25
)
## Example 4: CO2 dataset (base R)
plot_norm(
data = CO2,
vars = c("uptake", "conc"),
geom = "hist",
bins = 3
)
Run the code above in your browser using DataLab