as.data.frame.Cube: Converts the actual view of a cube to a data frame

Description Usage Arguments Value Author(s) See Also Examples

View source: R/cube.R

Description

Converts the actual view of a Cube object to a data frame. All added selections and aggregations will be regarded. Note that selection criteria will be applied before aggregating the data.

Usage

1
2
## S3 method for class 'Cube'
as.data.frame(x, row.names = NULL, optional = FALSE, ...)

Arguments

x

The Cube object that will be converted to a data frame.

row.names

A character vector giving the row names for the data frame.

optional

Should setting row names and converting column names be optional?

...

Further parameters that are passed to as.data.frame.table.

Value

A molten data frame

Author(s)

Michael Scholz michael.scholz@th-deg.de

See Also

add.aggregation add.selection

Examples

1
2
3
4
5
6
data("sales")
cube = generateCube(sales, columns = list(time = c("month", "year"),
      location = c("state"), product = "product"), valueColumn = "amount")
cube = change.dimensionOrder(cube, dimensions = c("product", "month", "year", "state"))
df = as.data.frame(cube)
df

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