tbl_mutate: Mutate Data with Various New Features

View source: R/basic_tbl_tools.R

tbl_mutateR Documentation

Mutate Data with Various New Features

Description

Mutate Data with Various New Features

Usage

tbl_mutate(
  data,
  group_variables = NULL,
  absolute_change_columns = NULL,
  cumulative_sum_columns = NULL,
  cumulative_mean_columns = NULL,
  cummulative_min_columns = NULL,
  cumulative_max_columns = NULL,
  percent_change_columns = NULL,
  index_columns = NULL,
  index_calculation_variable = NULL,
  index_override_value = NULL,
  lag_columns = NULL,
  lead_columns = NULL,
  min_rank_columns = NULL,
  pct_rank_columns = NULL,
  dense_rank_columns = NULL,
  ...
)

Arguments

...

Examples

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.