populate_star {data.cube}R Documentation

Populate star schema tables

Description

Populates example sales data based on mtcars, state, HairEyeColor datasets.

Usage

populate_star(N = 100000L, Y = c(2010L, 2014L), surrogate.keys = FALSE,
  hierarchies = TRUE, seed = 1L)

Arguments

N

integer count of rows in fact table before sub-aggregation to all dimensions.

Y

integer vector of year range (scalar or length 2) to generate time dimension, default c(2010L, 2014L) results in 365 dim cardinality.

surrogate.keys

logical if integer sequence column should be used or the lowest granularity natural key.

hierarchies

logical default FALSE, if TRUE the third element in list will be returned with hierarchy as list of character column names. List can be used when creating data.cube.

seed

integer used for set.seed when producing fact table from dimensions. Default fixed to 1L.

Value

List of two list named fact and dims. The fact list keeps single fact data.table sub-aggregated to all dimensions. The dims list keeps five dimension data.tables.


[Package data.cube version 0.4.0 Index]