reorder_forest: Reorder a factor for a forest plot

View source: R/functions.R

reorder_forestR Documentation

Reorder a factor for a forest plot

Description

Orders levels of x by bvar (via fn), with "Summary" optionally pinned to the bottom (or top).

Usage

reorder_forest(
  x,
  bvar,
  fn = mean,
  descending = TRUE,
  summary_bottom = TRUE,
  ...
)

Arguments

x

Character/factor column to turn into an ordered factor.

bvar

Numeric variable used for ordering (e.g. the point estimate).

fn

Aggregation function (default mean).

descending

Logical; if TRUE largest value gets the top row.

summary_bottom

Logical; if TRUE "Summary" is pinned to row 1 (bottom of a ggplot y-axis).

...

Other arguments, currently unimplemented.


VizTest documentation built on Aug. 28, 2026, 9:06 a.m.