View source: R/star_schema_character_dimensions.R
character_dimensions | R Documentation |
Transforms numeric type attributes of dimensions into character type. In a
star_schema
numerical data are measurements that are situated in the facts.
Numerical data in dimensions are usually codes, day, week, month or year
numbers. There are tools that consider any numerical data to be a
measurement, for this reason it is appropriate to transform the numerical
data of dimensions into character data.
character_dimensions(st, length_integers = list(), NA_replacement_value = NULL)
## S3 method for class 'star_schema'
character_dimensions(st, length_integers = list(), NA_replacement_value = NULL)
st |
A |
length_integers |
A |
NA_replacement_value |
A string, value to replace NA values. |
It allows indicating the amplitude for some fields, filling with zeros on the left. This is useful to make the alphabetical order of the result correspond to the numerical order.
It also allows indicating the literal to be used in case the numerical value is not defined.
If a role playing dimension has been defined, the transformation is performed on it.
A star_schema
object.
Other star schema and constellation definition functions:
constellation()
,
role_playing_dimension()
,
snake_case()
,
star_schema()
st <- star_schema(mrs_age_test, dm_mrs_age) |>
role_playing_dimension(
dim_names = c("when", "when_available"),
name = "When Common",
attributes = c("date", "week", "year")
) |>
character_dimensions(length_integers = list(week = 2),
NA_replacement_value = "Unknown")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.