Learn R Programming

LDATS (version 0.3.0)

iftrue: Replace if TRUE

Description

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

Usage

iftrue(x = TRUE, alt = NULL)

Value

x if not TRUE, alt otherwise.

Arguments

x

Focal input.

alt

Alternative value.

Examples

Run this code
 iftrue()
 iftrue(TRUE, 1)
 iftrue(2, 1)
 iftrue(FALSE, 1)

Run the code above in your browser using DataLab