A wrapper for ifelse(test(x), fun(x, ...), x)
ifelse(test(x), fun(x, ...), x)
capply(test, x, fun, ...)
test
a test that returns a logical
x
data to apply fun to.
fun
to apply
...
other arguments to fun