tbl_group_variables: Create grouping variable

tbl_group_variablesR Documentation

Create grouping variable

Description

Create grouping variable

Usage

tbl_group_variables(
  data,
  group_variables = NULL,
  group_name = "group",
  override_group_name = F,
  sep = "|",
  remove = T
)

Arguments

group_variables

vector of grouping variables

group_name

name of new column

override_group_name
sep

separator

remove

remove original columns

Value

'tibble'

Examples

library(tidyverse)
library(asbtools)
diamonds %>% tbl_group_variables(group_variables = c("cut", "clarity"))
diamonds %>% tbl_group_variables(group_variables = c("cut", "clarity"), group_name = NULL)
diamonds %>% tbl_group_variables(group_variables = c("cut", "clarity"), group_name = NULL, remove = F)


abresler/asbtools documentation built on July 28, 2022, 11:04 p.m.