remove.aggregation {hypercube}R Documentation

Removes aggregations from a hypercube

Description

This function removes aggregations from a hypercube. The cube itself will not be changed. The aggregation only affect the data that will be shown when printing the cube.

Usage

remove.aggregation(x, dimensions = NA, last = FALSE)

Arguments

x

Hypercube from which the aggregation will be removed.

dimensions

A vector of dimensions for which the aggregations will be removed.

last

Should the last aggregation be removed? If this parameter is set TRUE, the dimension vector will be ignored.

Value

Returns a Cube object with the added aggregation.

Author(s)

Michael Scholz michael.scholz@th-deg.de

See Also

Cube add.aggregation remove.selection

Examples


data("sales")
cube = generateCube(sales, columns = list(time = c("month", "year"),
      location = c("state"), product = "product"), valueColumn = "amount")
cube = add.aggregation(cube, dimensions = c("month", "year"), fun = "sum")
cube
cube = add.aggregation(cube, dimensions = "year", fun = "sum")
cube
cube = remove.aggregation(cube, dimensions = "year")
cube


[Package hypercube version 0.2.1 Index]