group_split.: Split data frame by groups

Description Usage Arguments Examples

View source: R/group_split.R

Description

Split data frame by groups. Returns a list.

Usage

1
group_split.(.df, ..., .keep = TRUE, .named = FALSE)

Arguments

.df

A data.frame or data.table

...

Columns to group and split by. tidyselect compatible.

.keep

Should the grouping columns be kept

.named

experimental: Should the list be named with labels that identify the group

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
test_df <- tidytable(
  a = 1:3,
  b = 1:3,
  c = c("a","a","b"),
  d = c("a","a","b")
)

test_df %>%
  group_split.(c, d)

test_df %>%
  group_split.(c, d, .keep = FALSE)

test_df %>%
  group_split.(c, d, .named = TRUE)

mtfairbanks/gdt documentation built on May 4, 2021, 9:44 a.m.