[
https://issues.apache.org/jira/browse/SPARK-10106?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Yu Ishikawa updated SPARK-10106:
--------------------------------
Description:
Add a column function on a DataFrame like `ifelse` in R to SparkR.
I guess we could implement it with a combination with {{when}} and
{{otherwise}}.
h3. Example
If {{df$x > 0}} is TRUE, then return 0, otherwise return 1.
{noformat}
ifelse(df$x > 0, 0, 1)
{noformat}
was:
Add a column function on a DataFrame like `ifelse` in R to SparkR.
I guess we could implement it with a combination with {{when}} and
{{otherwise}}.
h3. Example
If {{df$x > 0}} is TRUE, then return 0, else return 1.
{noformat}
ifelse(df$x > 0, 0, 1)
{noformat}
> Add `ifelse` Column function to SparkR
> --------------------------------------
>
> Key: SPARK-10106
> URL: https://issues.apache.org/jira/browse/SPARK-10106
> Project: Spark
> Issue Type: New Feature
> Components: SparkR
> Reporter: Yu Ishikawa
>
> Add a column function on a DataFrame like `ifelse` in R to SparkR.
> I guess we could implement it with a combination with {{when}} and
> {{otherwise}}.
> h3. Example
> If {{df$x > 0}} is TRUE, then return 0, otherwise return 1.
> {noformat}
> ifelse(df$x > 0, 0, 1)
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]