Learn R Programming

statuser (version 0.1.9)

validate_t.test2: 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
)

Value

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

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.