% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/as_forest_data.R
\name{as_forest_data}
\alias{as_forest_data}
\title{Standardize coefficient data for forest plots}
\usage{
as_forest_data(
  data,
  term,
  estimate,
  conf.low,
  conf.high,
  label = term,
  group = NULL,
  grouping = NULL,
  separate_groups = NULL,
  n = NULL,
  events = NULL,
  p.value = NULL,
  exponentiate = FALSE,
  sort_terms = c("none", "descending", "ascending")
)
}
\arguments{
\item{data}{A data frame containing coefficient estimates and intervals.}

\item{term}{Column name holding the model term identifier.}

\item{estimate}{Column name holding the point estimate.}

\item{conf.low}{Column name holding the lower confidence bound.}

\item{conf.high}{Column name holding the upper confidence bound.}

\item{label}{Optional column name used for the displayed row label.}

\item{group}{Optional column name used for color-grouping multiple
estimates per row.}

\item{grouping}{Optional column name used to split rows into grouped plot
sections.}

\item{separate_groups}{Optional column name used to identify labeled
variable blocks that can be outlined with separator lines.}

\item{n}{Optional column name holding sample sizes or other N labels for
table helpers.}

\item{events}{Optional column name holding event counts or event labels for
table helpers.}

\item{p.value}{Optional column name holding p-values.}

\item{exponentiate}{Logical; if \code{TRUE}, require positive values for
estimates and intervals.}

\item{sort_terms}{How to sort rows: \code{"none"}, \code{"descending"}, or
\code{"ascending"}.}
}
\value{
A standardized data frame ready for \code{\link[=ggforestplot]{ggforestplot()}} and the table
composition helpers.
}
\description{
Standardizes a coefficient table into the internal forest-plot data
structure used throughout \code{ggforestplotR}.
}
\examples{
raw <- data.frame(
  variable = c("Age", "BMI", "Treatment"),
  beta = c(0.10, -0.08, 0.34),
  lower = c(0.02, -0.16, 0.12),
  upper = c(0.18, 0.00, 0.56)
)

as_forest_data(
  data = raw,
  term = "variable",
  estimate = "beta",
  conf.low = "lower",
  conf.high = "upper"
)
}
