plot_qq_plot: Create Q-Q plot

View source: R/PlotQQPlot.R

plot_qq_plotR Documentation

Create Q-Q plot

Description

Create a figure that plots the expected, theoretical normal quantiles (z-scores) against the observed normal quantiles (z-scores) of the data.

Usage

plot_qq_plot(
  x,
  transformer,
  show_original = TRUE,
  show_identity = TRUE,
  use_alpha = TRUE,
  ggtheme = NULL
)

Arguments

x

A vector with numeric values that should be transformed to normality.

transformer

A transformer object created using find_transformation_parameters.

show_original

Show quantiles for original, untransformed, data in addition to transformed data.

show_identity

Show identity line that indicates equivalence between expected and observed quantiles.

use_alpha

Use transparency for points in case the data contains many instances.

ggtheme

ggplot2 theme to use for the plot. If not provided, ggplot2::theme_light is used.

Value

A ggplot2 plot object for a Q-Q plot.

Examples

x <- exp(stats::rnorm(1000))
transformer <- find_transformation_parameters(
  x = x,
  method = "box_cox")

if (rlang::is_installed("ggplot2")) {
  plot_qq_plot(
    x = x,
    transformer = transformer
  )
}


power.transform documentation built on April 12, 2025, 5:08 p.m.