powered by
Evaluates a list of conditions and returns one of multiple possible result expressions. For unmatched expressions null is returned.
when(condition, value)# S4 method for Column when(condition, value)
# S4 method for Column when(condition, value)
the condition to test on. Must be a Column expression.
result expression.
ifelse
Other normal_funcs: abs, bitwiseNOT, coalesce, column, expr, greatest, ifelse, isnan, least, lit, nanvl, negate, randn, rand, struct
abs
bitwiseNOT
coalesce
column
expr
greatest
isnan
least
lit
nanvl
negate
randn
rand
struct
# NOT RUN { when(df$age == 2, df$age + 1) # }
Run the code above in your browser using DataLab