If Else wrapper using kit::iif()
Value
vector of same length as x
and attributes as yes
. Data values
are taken from values of yes
and no
.
Examples
x <- c(1:4, 3:2, 1:4)
iif_else(x > 2L, x, x - 1L)
#> [1] 0 1 3 4 3 1 0 1 3 4
If Else wrapper using kit::iif()
vector of same length as x
and attributes as yes
. Data values
are taken from values of yes
and no
.
x <- c(1:4, 3:2, 1:4)
iif_else(x > 2L, x, x - 1L)
#> [1] 0 1 3 4 3 1 0 1 3 4