jn_layer: Add Johnson-Neyman Bounds to an interplot

View source: R/johnson_neyman.R

jn_layerR Documentation

Add Johnson-Neyman Bounds to an interplot

Description

Returns a list of ggplot2 layers that overlay Johnson-Neyman significance boundaries on an interplot output. Add to any interplot with +.

Usage

jn_layer(
  jn,
  line_color = "red",
  linetype = "dashed",
  shade_color = "grey80",
  shade_alpha = 0.15,
  label = TRUE
)

Arguments

jn

A jn_interval object produced by jn_interval.

line_color

Color of the boundary lines. Default "red".

linetype

Line type for boundaries. Default "dashed".

shade_color

Fill color for non-significant regions. Default "grey80".

shade_alpha

Transparency of shading. Default 0.15.

label

Logical; if TRUE (default), annotate the JN bound values.

Value

A list of ggplot2 layers.

Examples

m <- lm(mpg ~ wt * cyl, data = mtcars)
jn <- jn_interval(m, "cyl", "wt")
interplot(m, "cyl", "wt") + jn_layer(jn)


interplot documentation built on June 24, 2026, 5:08 p.m.