From bf32c1f7f47dd907d787469f979c5859e02ce5e6 Mon Sep 17 00:00:00 2001 From: Yu ISHIKAWA Date: Tue, 18 Aug 2015 20:27:36 -0700 Subject: [SPARK-10075] [SPARKR] Add `when` expressino function in SparkR - Add `when` and `otherwise` as `Column` methods - Add `When` as an expression function - Add `%otherwise%` infix as an alias of `otherwise` Since R doesn't support a feature like method chaining, `otherwise(when(condition, value), value)` style is a little annoying for me. If `%otherwise%` looks strange for shivaram, I can remove it. What do you think? ### JIRA [[SPARK-10075] Add `when` expressino function in SparkR - ASF JIRA](https://issues.apache.org/jira/browse/SPARK-10075) Author: Yu ISHIKAWA Closes #8266 from yu-iskw/SPARK-10075. --- R/pkg/NAMESPACE | 2 ++ 1 file changed, 2 insertions(+) (limited to 'R/pkg/NAMESPACE') diff --git a/R/pkg/NAMESPACE b/R/pkg/NAMESPACE index 607aef2611..8fa12d5ade 100644 --- a/R/pkg/NAMESPACE +++ b/R/pkg/NAMESPACE @@ -152,6 +152,7 @@ exportMethods("abs", "n_distinct", "nanvl", "negate", + "otherwise", "pmod", "quarter", "reverse", @@ -182,6 +183,7 @@ exportMethods("abs", "unhex", "upper", "weekofyear", + "when", "year") exportClasses("GroupedData") -- cgit v1.2.3