dimension_reduction | R Documentation |
The module combines multiple variables into a new variable. The new variable
can be a linear combination of the original variables,
aggregate_linear()
, or a geometric mean of the original variables,
aggregate_geometry()
, or created from an user formula input,
aggregate_manual()
.
dimension_reduction(data, ...)
aggregate_linear(formula, weight)
aggregate_geometrical(formula)
aggregate_manual(formula)
data |
used in |
... |
used in |
formula |
the formula to evaluate |
weight |
used in |
an index table object
dt <- gggi |>
dplyr::select(country, sex_ratio_at_birth:healthy_life_expectancy) |>
init()
dt |>
dimension_reduction(health = aggregate_manual(
~sex_ratio_at_birth * 0.693 + healthy_life_expectancy * 0.307))
dt |>
add_paras(gggi_weights, by = variable) |>
dimension_reduction(health = aggregate_linear(
~sex_ratio_at_birth:healthy_life_expectancy, weight = var_weight))
dt |>
dimension_reduction(health = aggregate_geometrical(
~sex_ratio_at_birth:healthy_life_expectancy)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.