fp_set_summary: Selector-based summary rows

View source: R/text_styling.R

fp_set_summaryR Documentation

Selector-based summary rows

Description

Set is.summary rows on a gforge_forestplot object using a row predicate. This helper is intended for pipe-first workflows where summary rows are decided after label extraction/remapping.

Usage

fp_set_summary(x, where)

Arguments

x

A gforge_forestplot object.

where

A row predicate. Supports:

  • a bare expression evaluated in source data columns (when available), e.g. startsWith(type, "Subtotal") | startsWith(type, "Total")

  • a one-sided formula, e.g. ~ Type %in% c("header", "subtotal")

  • a function receiving selector data and returning a logical vector

  • a logical scalar/vector

Value

A modified gforge_forestplot object.

Examples

data(inventors_vs_mello)
inventors_vs_mello |>
  forestplot(mean = est, lower = lb, upper = ub, labeltext = author) |>
  fp_extract_labels(Study = author) |>
  fp_set_summary(startsWith(type, "subtotal") | startsWith(type, "total"))

forestplot documentation built on March 4, 2026, 9:06 a.m.