Sample quantiles against the quantiles of a reference distribution; points on a straight line mean the sample follows it. Add geom_qq_line() for the reference.

geom_qq(
  mapping = NULL,
  data = NULL,
  distribution = stats::qnorm,
  color = NULL,
  size = NULL,
  alpha = NULL
)

geom_qq_line(
  mapping = NULL,
  data = NULL,
  distribution = stats::qnorm,
  color = NULL,
  linewidth = NULL,
  alpha = NULL
)

Arguments

mapping, data

Standard layer overrides. Map the values to x.

distribution

Quantile function of the reference distribution (default stats::qnorm).

color, size, alpha

Appearance.

linewidth

Line width for the reference line.

Value

A Layer to add with +.

Examples

set.seed(1)
d <- data.frame(v = rnorm(100))
ggnext(d, aes(v)) + geom_qq() + geom_qq_line()
#> <ggnext plot>
#>   data:  100 x 1
#>   aes:   x = v
#>   layers: 2 
#>   coord: cartesian
#>   mode:  static