inst/examples/tbl_mutate_examples.R

library(tidyverse)
library(asbtools)

calculation_variables <- c("pop", "gdpPercap", "lifeExp")

data = gapminder::gapminder
gapminder::gapminder %>%
  tbl_mutate(
    group_variables = "country",
    index_columns = calculation_variables,
    index_calculation_variable = "year",
    cumulative_mean_columns = calculation_variables,
    min_rank_columns = calculation_variables
  )


gapminder::gapminder %>%
  tbl_mutate(
    group_variables = "country",
    index_columns = calculation_variables,
    index_calculation_variable = "year",
    cumulative_mean_columns = calculation_variables,
    min_rank_columns = calculation_variables,
    index_override_value = 2002
  )
abresler/asbtools documentation built on July 28, 2022, 11:04 p.m.