validate_t.test2: Validate Grouping Variable for t.test2()

View source: R/validate.R

validate_t.test2R Documentation

Validate Grouping Variable for t.test2()

Description

Validates that a grouping variable exists and has exactly 2 levels for t-test.

Usage

validate_t.test2(
  group_var_name,
  data = NULL,
  calling_env = parent.frame(),
  data_name = NULL
)

Arguments

group_var_name

Character string. Name of the grouping variable (for error messages).

data

An optional data frame containing the variable.

calling_env

The environment in which to look for the variable if data is not provided.

data_name

Character string. Name of the data argument (for error messages). If NULL, will attempt to infer from the call.

Value

The validated grouping variable (numeric or factor vector). Stops execution with an error message if validation fails.


statuser documentation built on April 25, 2026, 5:06 p.m.