powered by
The ifelseObj function just evaluates a condition, returning one object if it's true, and another if it's false.
ifelseObj(condition, ifTrue, ifFalse)
One of the two objects
Condition to evaluate.
Object to return if the condition is true.
Object to return if the condition is false.
dat <- ifelseObj(sample(c(TRUE, FALSE), 1), mtcars, Orange);
Run the code above in your browser using DataLab