powered by
`ifelse` methods extend `base::ifelse` to allow using dual objects for 'yes' or 'no' arguments.
ifelse(test, yes, no)
A dual object (dual vector).
an object which can be coerced to logical mode.
return values for true elements of 'test'.
return values for false elements of 'test'.
x <- dual(c(1,2,4,6)) y <- ifelse(x > 2, x, x/2) y d(y)
Run the code above in your browser using DataLab