enrich_dimension_import: Import 'tibble' to enrich a dimension

View source: R/star_schema_enrich_dimension.R

enrich_dimension_importR Documentation

Import tibble to enrich a dimension

Description

For a dimension of a star schema a tibble is attached. This contains dimension attributes and new attributes. If values associated with all rows in the dimension are included in the tibble, the dimension is enriched with the new attributes.

Usage

enrich_dimension_import(st, name = NULL, tb)

## S3 method for class 'star_schema'
enrich_dimension_import(st, name = NULL, tb)

Arguments

st

A star_schema object.

name

A string, name of the dimension.

tb

A tibble object.

Details

Role dimensions cannot be directly enriched. If a role playing dimension is enriched, the new attributes are also added to the associated role dimensions.

Value

A star_schema object.

See Also

Other dimension enrichment functions: enrich_dimension_export(), enrich_dimension_import_test()

Examples


tb <-
  enrich_dimension_export(st_mrs_age,
                          name = "when_common",
                          attributes = c("week", "year"))

# Add new columns with meaningful data (these are not), possibly exporting
# data to a file, populating it and importing it.
tb <- tibble::add_column(tb, x = "x", y = "y", z = "z")

st <- enrich_dimension_import(st_mrs_age, name = "when_common", tb)


josesamos/starschemar documentation built on May 6, 2024, 5:57 a.m.