[ 
https://issues.apache.org/jira/browse/SPARK-6813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14604333#comment-14604333
 ] 

Vincent Warmerdam commented on SPARK-6813:
------------------------------------------

What is the current consensus on the use of magrittr? It offers the pipe 
operator (%>%) which allows for more elegant code. Dplyr is heavily dependant 
on it. 

### example 1

log(sqrt(2))
 2 %>% sqrt %>% log 

### example 2

head(summarize(groupBy(dist_df, df$type), count = n(df$auc)))

dist_df %>% 
  groupBy(df$type) %>% 
  summarize(count = n(df$id)) %>% 
  head

The %>% operator creates more readable code and still allows the DAG to get 
executed as normal. Should this not be part of the style guide for sparkR? 

> SparkR style guide
> ------------------
>
>                 Key: SPARK-6813
>                 URL: https://issues.apache.org/jira/browse/SPARK-6813
>             Project: Spark
>          Issue Type: New Feature
>          Components: SparkR
>            Reporter: Shivaram Venkataraman
>
> We should develop a SparkR style guide document based on the some of the 
> guidelines we use and some of the best practices in R.
> Some examples of R style guide are:
> http://r-pkgs.had.co.nz/r.html#style 
> http://google-styleguide.googlecode.com/svn/trunk/google-r-style.html
> A related issue is to work on a automatic style checking tool. 
> https://github.com/jimhester/lintr seems promising
> We could have a R style guide based on the one from google [1], and adjust 
> some of them with the conversation in Spark:
> 1. Line Length: maximum 100 characters
> 2. no limit on function name (API should be similar as in other languages)
> 3. Allow S4 objects/methods



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to