Github user HyukjinKwon commented on a diff in the pull request:

    https://github.com/apache/spark/pull/23072#discussion_r239701069
  
    --- Diff: R/pkg/vignettes/sparkr-vignettes.Rmd ---
    @@ -968,6 +970,17 @@ predicted <- predict(model, df)
     head(predicted)
     ```
     
    +#### Power Iteration Clustering
    +
    +Power Iteration Clustering (PIC) is a scalable graph clustering algorithm. 
`spark.assignClusters` method runs the PIC algorithm and returns a cluster 
assignment for each input vertex.
    +
    +```{r}
    +df <- createDataFrame(list(list(0L, 1L, 1.0), list(0L, 2L, 1.0),
    +                      list(1L, 2L, 1.0), list(3L, 4L, 1.0),
    --- End diff --
    
    There are two separate style are already mixed in R code IIRC:
    
    ```r
    df <- createDataFrame(
      list(list(0L, 1L, 1.0), list(0L, 2L, 1.0),
      list(1L, 2L, 1.0), list(3L, 4L, 1.0),
      list(4L, 0L, 0.1)), schema = c("src", "dst", "weight"))
    ```
    
    or
    
    ```r
    df <- createDataFrame(list(list(0L, 1L, 1.0), list(0L, 2L, 1.0),
                               list(1L, 2L, 1.0), list(3L, 4L, 1.0),
                               list(4L, 0L, 0.1)),
                          schema = c("src", "dst", "weight"))
    ```
    
    Let's avoid mixed style, and let's go for the later one when possible 
because at least that looks more complying the code style.


---

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

Reply via email to