Skip to contents

Create a multi-dimensional cube for the SparkDataFrame using the specified columns.

Usage

cube(x, ...)

# S4 method for SparkDataFrame
cube(x, ...)

Arguments

x

a SparkDataFrame.

...

character name(s) or Column(s) to group on.

Value

A GroupedData.

Details

If grouping expression is missing cube creates a single global aggregate and is equivalent to direct application of agg.

Note

cube since 2.3.0

Examples

if (FALSE) {
df <- createDataFrame(mtcars)
mean(cube(df, "cyl", "gear", "am"), "mpg")

# Following calls are equivalent
agg(cube(df), mean(df$mpg))
agg(df, mean(df$mpg))
}