validate_outcome_exists: Validate outcome exists in data

validate_outcome_existsR Documentation

Validate outcome exists in data

Description

Checks that the specified outcome variable (or survival variables within Surv() expression) exists in the dataset. Raises informative error if variables are missing. Handles both simple outcomes and Surv() expressions.

Usage

validate_outcome_exists(data, outcome)

Arguments

data

Data frame or data.table to check.

outcome

Character string outcome specification (may include Surv()).

Value

Invisible TRUE if validation passes, otherwise stops with error.


summata documentation built on May 7, 2026, 5:07 p.m.