when {SparkR}R Documentation

when

Description

Evaluates a list of conditions and returns one of multiple possible result expressions. For unmatched expressions null is returned.

Usage

when(condition, value)

## S4 method for signature 'Column'
when(condition, value)

Arguments

condition

the condition to test on. Must be a Column expression.

value

result expression.

Note

when since 1.5.0

See Also

ifelse

Other normal_funcs: abs, bitwiseNOT, coalesce, column, expr, from_json, greatest, ifelse, isnan, least, lit, nanvl, negate, randn, rand, struct, to_json

Examples

## Not run: when(df$age == 2, df$age + 1)

[Package SparkR version 2.2.1 Index]