GitHub user HyukjinKwon opened a pull request:
https://github.com/apache/spark/pull/19706
[SPARK-22476][R] Add dayofweek function to R
## What changes were proposed in this pull request?
This PR adds `dayofweek` to R API:
```r
data <- list(list(d = as.Date("2012-12-13")),
list(d = as.Date("2013-12-14")),
list(d = as.Date("2014-12-15")))
df <- createDataFrame(data)
collect(select(df, dayofweek(df$d)))
```
```
dayofweek(d)
1 5
2 7
3 2
```
## How was this patch tested?
Manual tests and unit tests in `R/pkg/tests/fulltests/test_sparkSQL.R`
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/HyukjinKwon/spark add-dayofweek
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/19706.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #19706
----
commit d24a89b6a756457c651d0c208ccbe59b979e9ecc
Author: hyukjinkwon <[email protected]>
Date: 2017-11-08T11:31:35Z
Add support for dayofweek function in R
----
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]