apa_cor: APA-formatted correlation table

View source: R/tables.R

apa_corR Documentation

APA-formatted correlation table

Description

APA-formatted correlation table

Usage

apa_cor(
  data,
  note = NULL,
  p_value = c(0.05, 0.01, 0.001),
  digits = 2,
  bold_significant = FALSE,
  star_significant = TRUE,
  significance_note = TRUE,
  output = c("flextable", "tibble"),
  font_family = NULL,
  font_size = 12,
  text_color = "black",
  border_color = "black",
  border_width = 0.5,
  line_spacing = 2,
  table_width = 6.5,
  keep_empty_star_columns = TRUE,
  summary_functions = list(M = mean, SD = stats::sd),
  column_formats = NULL,
  ...
)

Arguments

data

data.frame or tibble with variables to be

note

Custom note to appear below table. (Overrides automatic note.)

p_value

p-value needed to be flagged as significant

digits

Number of digits for rounding

bold_significant

bold significant correlations

star_significant

start significant correlations

significance_note

If TRUE, place note at bottom of table that significant correlations are bolded.

output

output type. Can be "flextable" or "tibble"

font_family

font family

font_size

font size

text_color

text color

border_color

border color

border_width

border width in pixels

line_spacing

spacing between lines

table_width

table width (in pixels, 0 for auto)

keep_empty_star_columns

Keep remove empty star columns (Default: TRUE)

summary_functions

Any named list of functions that summarize data columns (e.g., list(Mean = mean, SD = sd)). Can also be a character vector of function names (e.g., c("n", "M", "SD")). Functions available in a character vector: IQR, Interquartile Range, Kurtosis, MAD, Median Absolute Deviation, M, Mean, Med, Median, n, N, Quantile, Range, SD, Skewness, Var, Variance

column_formats

column_formats object

...

<data-masking> parameters passed to psych::corTest

Value

flextable::flextable

Examples

apa_cor(mtcars[, c("mpg", "am", "gear", "carb")])
apa_cor(mtcars[, c("mpg", "am", "gear", "carb")],
        output = "tibble",
        star_significant = FALSE)

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