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

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

See Also

ifelse

Other normal_funcs: abs; bitwiseNOT, bitwiseNOT; col, column, column; expr, expr; greatest, greatest; ifelse; is.nan, isnan, isnan; least, least; lit, lit; nanvl, nanvl; negate, negate; randn, randn, randn; rand, rand, rand; struct, struct

Examples

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

[Package SparkR version 1.6.1 Index]