If the focal input is TRUE, replace it with alternative.

iftrue(x = TRUE, alt = NULL)

Arguments

x

Focal input.

alt

Alternative value.

Value

x if not TRUE, alt otherwise.

Examples

 iftrue()
 iftrue(TRUE, 1)
 iftrue(2, 1)
 iftrue(FALSE, 1)