View source: R/star_schema_role_playing_dimension.R
role_playing_dimension | R Documentation |
star_schema
objectGiven a list of star_schema
dimension names, all with the same structure, a
role playing dimension with the indicated name and attributes is generated.
The original dimensions become role dimensions defined from the new role
playing dimension.
role_playing_dimension(st, dim_names, name = NULL, attributes = NULL)
## S3 method for class 'star_schema'
role_playing_dimension(st, dim_names, name = NULL, attributes = NULL)
st |
A |
dim_names |
A vector of dimension names. |
name |
A string, name of the role playing dimension. |
attributes |
A vector of attribute names of the role playing dimension. |
After definition, all role dimensions have the same virtual instances (those of the role playing dimension). The foreign keys in facts are adapted to this new situation.
A star_schema
object.
Other star schema and constellation definition functions:
character_dimensions()
,
constellation()
,
snake_case()
,
star_schema()
st <- star_schema(mrs_age, dm_mrs_age) |>
role_playing_dimension(
dim_names = c("when", "when_available"),
name = "When Common",
attributes = c("Date", "Week", "Year")
)
st <- star_schema(mrs_cause, dm_mrs_cause) |>
role_playing_dimension(
dim_names = c("when", "when_received", "when_available"),
name = "when_common",
attributes = c("date", "week", "year")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.