Validates that a grouping variable exists and has exactly 2 levels for t-test.
validate_t.test2(
group_var_name,
data = NULL,
calling_env = parent.frame(),
data_name = NULL
)The validated grouping variable (numeric or factor vector). Stops execution with an error message if validation fails.
Character string. Name of the grouping variable (for error messages).
An optional data frame containing the variable.
The environment in which to look for the variable if data is not provided.
Character string. Name of the data argument (for error messages). If NULL, will attempt to infer from the call.