Learn R Programming

cheapr (version 1.4.0)

if_else: Cheaper version of ifelse()

Description

Cheaper version of ifelse()

Usage

if_else_(condition, true, false, na = NULL)

cheapr_if_else(condition, true, false, na = NULL)

Value

A vector the same length as condition, using a common type between true, false and na.

Arguments

condition

logical A condition which will be used to evaluate the if else operation.

true

Value(s) to replace TRUE instances.

false

Value(s) to replace FALSE instances.

na

Catch-all value(s) to replace all other instances, where is.na(condition).

See Also

case val_match