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

    https://github.com/apache/spark/pull/17728#discussion_r112845286
  
    --- Diff: R/pkg/R/DataFrame.R ---
    @@ -3642,3 +3642,58 @@ setMethod("checkpoint",
                 df <- callJMethod(x@sdf, "checkpoint", as.logical(eager))
                 dataFrame(df)
               })
    +
    +
    +#' cube
    +#'
    +#' Create a multi-dimensional cube for the SparkDataFrame using the 
specified columns.
    +#'
    +#' @param x a SparkDataFrame.
    +#' @param ... variable(s) (character names(s) or Column(s)) to group on.
    +#' @return A GroupedData.
    +#' @family SparkDataFrame functions
    +#' @aliases cube,SparkDataFrame-method
    +#' @rdname cube
    +#' @name cube
    +#' @export
    +#' @examples
    +#' \dontrun{
    +#' df <- createDataFrame(mtcars)
    +#' mean(cube(df, "cyl", "gear", "am"), "mpg")
    +#' }
    +#' @note cube since 2.3.0
    +setMethod("cube",
    +          signature(x = "SparkDataFrame"),
    +          function(x, ...) {
    +            cols <- list(...)
    --- End diff --
    
    hmm, it's a bit odd to call rollup or cube that way but ok if other 
languages leave that open too. but I'd say we should add a line to explain 
"rollup or cube without column is the same as group_by" (or something better)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to