ufs (version 0.5.12)

ifelseObj: Conditional returning of an object

Description

The ifelseObj function just evaluates a condition, returning one object if it's true, and another if it's false.

Usage

ifelseObj(condition, ifTrue, ifFalse)

Value

One of the two objects

Arguments

condition

Condition to evaluate.

ifTrue

Object to return if the condition is true.

ifFalse

Object to return if the condition is false.

Examples

Run this code
dat <- ifelseObj(sample(c(TRUE, FALSE), 1), mtcars, Orange);

Run the code above in your browser using DataLab