powered by
This function generates a hypercube from a given dataframe. The dimensions of the hypercube correspond to a set of selected columns from the dataframe.
generateCube( data, columns, valueColumn, fun = c("sum", "min", "max", "prod", "mean", "median", "sd", "count") )
A dataframe that is used as source for the hypercube.
A vector of column names that will form the dimensions of the hypercube.
The name of the column that provides the values for the cells of the hypercube.
Aggregation function for aggregating over those columns that do not correspond with any dimension of the hypercube.
Returns a Cube object.
Cube
# NOT RUN { data("sales") cube = generateCube(sales, columns = list(time = c("month", "year"), location = c("state"), product = "product"), valueColumn = "amount") # }
Run the code above in your browser using DataLab