ifelse

Vectorized If-Else

Evaluates a condition and returns values from true_val or false_val depending on the condition. Supports missing value handling via the missing argument.

Parameters

Returns

A vector of the resulting values.

Examples

ifelse([true, false, NA], "Yes", "No", missing = "Unknown")