# NOT RUN {
x <- 1
x %>%
iff(is.na, const(0))
x <- NA
x %>%
iff(is.na, const(0))
x <- 1
x %>%
iff(x <= 0, function(x) { x - 2 })
x <- -1
x %>%
iff(x <= 0, function(x) { x - 2 })
x <- NA
x %>%
iffn(is.na, exp)
x <- 10
x %>%
iffn(is.na, exp)
# }
Run the code above in your browser using DataLab