apa_format_columns: Format data columns

View source: R/formatting.R

apa_format_columnsR Documentation

Format data columns

Description

Format data columns

Usage

apa_format_columns(
  data,
  column_formats = NULL,
  no_format_columns = NULL,
  rename_headers = TRUE,
  latex_headers = FALSE,
  format_separated_headers = TRUE,
  sep = "_",
  accuracy = NULL
)

Arguments

data

data set (data.frame or tibble)

column_formats

column_formats object. If NULL, the current default formatter set with apa7_defaults() will be used.

no_format_columns

Column name or tidyselect function. selected columns are not formatted

rename_headers

if TRUE, rename headers with markdown or latex

latex_headers

if TRUE, rename headers with latex instead of markdown

format_separated_headers

if TRUE, format headers with separated names. For example, if the formatter formats column R2 as ⁠*R*^2^⁠, then ⁠Model 1_R2⁠ becomes ⁠Model 1_*R*^2^⁠)

sep

separator for separated headers (default is "_")

accuracy

numeric (default: NULL, uses the current default accuracy set with apa7_defaults()). If not NULL, sets the accuracy for the formatter.

Value

tibble

Examples

lm(mpg ~ cyl + wt, data = mtcars) |>
  parameters::parameters() |>
  apa_format_columns() |>
  apa_flextable()

apa7 documentation built on May 26, 2026, 5:07 p.m.