add_decision_overlay: Add sample-size decision overlay to a conditional power...

View source: R/plotting-precision.R

add_decision_overlayR Documentation

Add sample-size decision overlay to a conditional power contour

Description

Overlays the output of decide_sample_size() as a step-line on a contour plot (e.g. from plot_power_contour()).

Usage

add_decision_overlay(p, decisions, x_effect = NULL, colour = "red")

Arguments

p

A ggplot object, typically from plot_power_contour().

decisions

A data.frame or tibble returned by decide_sample_size(), containing at least one effect column and n_recommended.

x_effect

Name of the effect column to use on the x-axis. If NULL, the first column that is not n_recommended or rationale is used.

colour

Colour for the overlay line (default "red").

Details

If the decisions contain multiple effect-grid columns, the overlay is aggregated over all effect columns except x_effect by taking the worst-case (maximum) recommended n at each value of x_effect.

Value

A ggplot object.


powerbrmsINLA documentation built on July 2, 2026, 5:07 p.m.