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)
)
Run the code above in your browser using DataLab