generateCube: Generates a hypercube from a given dataframe

Description Usage Arguments Value Author(s) See Also Examples

View source: R/cube.R

Description

This function generates a hypercube from a given dataframe. The dimensions of the hypercube correspond to a set of selected columns from the dataframe.

Usage

1
2
3
4
5
6
generateCube(
  data,
  columns,
  valueColumn,
  fun = c("sum", "min", "max", "prod", "mean", "median", "sd", "count")
)

Arguments

data

A dataframe that is used as source for the hypercube.

columns

A vector of column names that will form the dimensions of the hypercube.

valueColumn

The name of the column that provides the values for the cells of the hypercube.

fun

Aggregation function for aggregating over those columns that do not correspond with any dimension of the hypercube.

Value

Returns a Cube object.

Author(s)

Michael Scholz michael.scholz@th-deg.de

See Also

Cube

Examples

1
2
3
data("sales")
cube = generateCube(sales, columns = list(time = c("month", "year"),
      location = c("state"), product = "product"), valueColumn = "amount")

hypercube documentation built on March 26, 2020, 7:52 p.m.