prepare_box_data: Prepare Box Data

View source: R/utils.R

prepare_box_dataR Documentation

Prepare Box Data

Description

Prepares data for plotting boxes by calculating box boundaries based on category positions.

Usage

prepare_box_data(data, cat_a, cat_b, group, cat_a_order, cat_b_order)

Arguments

data

A data frame containing the variables.

cat_a

The name of the column representing category A.

cat_b

The name of the column representing category B.

group

The name of the column representing the grouping variable.

cat_a_order

A vector specifying the order of category A.

cat_b_order

A vector specifying the order of category B.

Value

A data frame with box boundaries for plotting.

Examples

library(dplyr)
data <- data.frame(
  cat_a = rep(letters[1:3], each = 2),
  cat_b = rep(LETTERS[1:2], times = 3),
  group = rep(c("G1", "G2"), times = 3)
)
cat_a_order <- c("a", "b", "c")
cat_b_order <- c("A", "B")
prepare_box_data(data, "cat_a", "cat_b", "group", cat_a_order, cat_b_order)

diceplot documentation built on June 25, 2025, 1:08 a.m.