define_dimension | R Documentation |
star_schema
object.Dimensions are part of a star_schema
object. They can be defined directly
as a dimension_schema
object or giving the name and a set of attributes.
define_dimension(
schema,
dimension,
name,
attributes,
scd_nk,
scd_t0,
scd_t1,
scd_t2,
scd_t3,
scd_t6,
is_when,
...
)
## S3 method for class 'star_schema'
define_dimension(
schema,
dimension = NULL,
name = NULL,
attributes = NULL,
scd_nk = NULL,
scd_t0 = NULL,
scd_t1 = NULL,
scd_t2 = NULL,
scd_t3 = NULL,
scd_t6 = NULL,
is_when = FALSE,
...
)
schema |
A |
dimension |
A |
name |
A string, name of the dimension. |
attributes |
A vector of attribute names. |
scd_nk |
A vector of attribute names, scd natural key. |
scd_t0 |
A vector of attribute names, scd T0 attributes. |
scd_t1 |
A vector of attribute names, scd T1 attributes. |
scd_t2 |
A vector of attribute names, scd T2 attributes. |
scd_t3 |
A vector of attribute names, scd T3 attributes. |
scd_t6 |
A vector of attribute names, scd T6 attributes. |
is_when |
A boolean, is when dimension. |
... |
When dimension configuration parameters. |
A star_schema
object.
star_database
Other star schema definition functions:
define_facts()
,
dimension_schema()
,
fact_schema()
,
star_schema()
s <- star_schema() |>
define_dimension(
name = "when",
attributes = c(
"Week Ending Date",
"WEEK",
"Year"
)
)
s <- star_schema()
d <- dimension_schema(
name = "when",
attributes = c(
"Week Ending Date",
"WEEK",
"Year"
)
)
s <- s |>
define_dimension(d)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.