geom_borrow: Plot a Bayesian basket trial's posterior distribution after...

View source: R/geoms.R

geom_borrowR Documentation

Plot a Bayesian basket trial's posterior distribution after borrowing

Description

Plot a Bayesian basket trial's posterior distribution after borrowing

Usage

geom_borrow(design, ...)

Arguments

design

An object created with one of the setup functions.

...

Further arguments to be passed to 'geom_function'.

Value

A list of ggplot layers of type 'geom_function'.

Examples

# Example for a basket trial with Fujikawa's Design
design <- setup_fujikawa(k = 3, p0 = 0.2)
n <- 20
r <- c(4, 5, 2)
epsilon <- 2
tau <- 0.5
# One facet per basket
library(ggplot2)
ggplot() +
    geom_borrow(design, n, r, epsilon, tau, logbase = exp(1)) +
    facet_wrap(vars(basket))
# Colour different baskets
ggplot() +
    geom_borrow(design, n, r, epsilon, tau,
                logbase = exp(1), aes(colour = basket))

basksim documentation built on May 12, 2026, 9:08 a.m.