test.t: Student's t-test (with automatic diagnostics)

View source: R/T_test.R

test.tR Documentation

Student's t-test (with automatic diagnostics)

Description

Performs Student's t-test to compare means between two independent groups, with automatic checks for normality and homogeneity of variances. If assumptions are violated, the Mann-Whitney test is automatically applied (without generating a plot).

Usage

test.t(
  ...,
  title = TRUE,
  title_text = "t-test",
  xlab = "Group",
  ylab = "Value",
  style = c("boxplot", "violin", "mono", "halfeye"),
  help = FALSE,
  verbose = TRUE
)

Arguments

...

Two numeric vectors or a data frame with exactly two columns.

title

Logical. If true, return a plot entitled.

title_text

Plot title (string). Default: "t-test".

xlab

X-axis label in the plot (string). Default: "Group".

ylab

Y-axis label in the plot (string). Default: "Value".

style

Plot aesthetic generated by the function.

help

Logical. If TRUE, shows a detailed explanation of the function. Default: FALSE.

verbose

Logical. If TRUE, prints detailed messages. Default: TRUE.

Value

Invisible list with summary, test test_result, method and (optionally) plot.

Examples

set.seed(123)
df <- data.frame(
  control = rnorm(30, 10),
  treatment = rnorm(30, 15)
)
test.t(df)

autotestR documentation built on April 29, 2026, 1:09 a.m.